Hjælp til array check i while loop
Hej der allesammen....Kan nogen fortælle mig hvorfor min foreach loop i det her kode ikke bliver gentjeket hver gang den løber gennem min while loop
while ($mylink = mysql_fetch_array($links)) {
if ($num_link == 0) { echo '<div class="mylinks">'; }
//// For bookmarking /////
if (isset($_SESSION['logged'])) {
$link_id = $mylink['id'];
foreach ($unbook_id as $bookvalue) {
if ($link_id === $bookvalue) { $booked = 1; } else {$booked=0;} }
if ( $booked ==0 ) {
echo $link_id; '<form method="post" action="'. $_SERVER['PHP_SELF'] .'?action=bookmark" style="float:left;margin-right:2px;">
<input type="image" src="porn_images/bookmark.gif" name="bmark" />
<input type="hidden" value="'.$link_id.'" name="linkid" />
</form>';
echo '<a href="'.$mylink['url'].'" target="_blank"><b>' .$mylink['url'].'</b></a><div style="clear:left;"></div>';
$num_link++;
} else if ($booked==1) {
echo '<form method="post" action="'. $_SERVER['PHP_SELF'] .'?action=bookmark" style="float:left;margin-right:2px;">
<input type="image" src="porn_images/unbookmark.gif" name="bmark" />
<input type="hidden" value="'.$link_id.'" name="linkid" />
</form>';
echo '<a href="'.$mylink['url'].'" target="_blank"><b>' .$mylink['url'].'</b></a><div style="clear:left;"></div>';
$num_link++;
}
}
if ($num_link >= ($numlinks/3)) { echo '</div>'; $num_link = 0; }
}