[SOLVED] fetch_row issue
Posted: Mon Apr 19, 2004 11:34 am
I have a problem, the following code pulls all from the DB but doesn't right the proper tblID for the first row listing.
Can anyone help?
Thanks in advance!
?>
[Edit: Added [SOLVED] to the topic, if you don't mind. --JAM]
Can anyone help?
Thanks in advance!
Code: Select all
<?php
$query="select tblID from mngENTRIES WHERE contestID = '$id' ORDER by tblID ASC";
$result = mysql_query($query);
$num_rows=mysql_num_rows($result);
for ($i=1; $i<=$num_rows; $i++) $newData[]=mysql_fetch_array($result);
mysql_close;
for ($i=1; $i<=$num_rows; $i++) {
$newData[]=mysql_fetch_array($result);
$currentRow = $newData[$i];
echo "<td><a href=entry_detail.php?id=".$currentRow[0]."><img src=entry/tn_".$currentRow[0].".jpg width=40 border=1><br>".$currentRow[0]."</a></td>\n";
if(($i % 2) == 0) {
echo "</tr>\n<tr>\n";
}
}
?>[Edit: Added [SOLVED] to the topic, if you don't mind. --JAM]