It means your query failed. Change $news = mysql_query('select * from ccl where '.$where.' order by AU desc');
TO: $news = mysql_query('select * from ccl where '.$where.' order by AU desc') or die("error: ".mysql_error()); this will display the error -----Original Message----- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: Monday, February 18, 2002 12:30 AM To: [EMAIL PROTECTED] Subject: [PHP] Frustrating ? Heres's a frustrating, and maybe not so stupid question? I'm getting "Warning: Supplied argument is not a valid MySQL result resource" on this line: while ($mydata = mysql_fetch_object($news)) So what am I doing wrong here: $where = "id like $id"; $news = mysql_query('select * from ccl where '.$where.' order by AU desc'); //desc => z-a while ($mydata = mysql_fetch_object($news)) { echo "<tr bgcolor=\"#CCCCCC\"><td align=center><a href=\"index.html?id=$mydata->id\">Print View</a></td><td>$mydata->id</td><td>$mydata->AU</td><td>$mydata->ST</td><td >$mydata->BT</td></tr>\n"; }#end of while I've tried variations like: $news = mysql_query('select * from ccl where id like $id order by AU desc'); $news = mysql_query("select * from ccl where id like $id order by AU desc"); $id checks out ok. I use index.html?id=4 AU exists; ok. So ... ? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php