I have a table that stores links (category, URL, desc, etc.). When I VIEW the table in myPHPAdmin all is fine. When I VIEW from my PHP web page I get all but the first record every time. And to make it a twist, let's say I have 10 categories for links. If I say SELECT * FROM links WHERE category ='8' I get everything except the first record ever stored (for that category). Here's my code, any ideas?
$category = "8";
$SQL = " SELECT * FROM links";
$SQL = $SQL . " WHERE category = '$category'";
$retid = mysql_db_query($db, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
$row = mysql_fetch_array($retid);
$siteurl = $row["siteurl"];
print ("<center><table cellpadding=2 cellspacing=0>\n");
while ($row = mysql_fetch_array($retid)) {
$siteurl = $row["siteurl"];
$sitename = $row["sitename"];
$description = $row["description"];
print ("<tr><td width=20%><b><font face=Arial size=2><A HREF='http://www.phpbuilder.com/board/archive/index.php/$siteurl'>$sitename</A></font></b></td>");
print ("<td width=80%><font face=Arial size=2>$description</font></td></tr>\n");
}
print("</table></center>");
$category = "8";
$SQL = " SELECT * FROM links";
$SQL = $SQL . " WHERE category = '$category'";
$retid = mysql_db_query($db, $SQL, $cid);
if (!$retid) { echo( mysql_error()); }
$row = mysql_fetch_array($retid);
$siteurl = $row["siteurl"];
print ("<center><table cellpadding=2 cellspacing=0>\n");
while ($row = mysql_fetch_array($retid)) {
$siteurl = $row["siteurl"];
$sitename = $row["sitename"];
$description = $row["description"];
print ("<tr><td width=20%><b><font face=Arial size=2><A HREF='http://www.phpbuilder.com/board/archive/index.php/$siteurl'>$sitename</A></font></b></td>");
print ("<td width=80%><font face=Arial size=2>$description</font></td></tr>\n");
}
print("</table></center>");