Frustrating ?

From: Date: Mon, 18 Feb 2002 06:30:21 +0000
Subject: Frustrating ?
Groups: php.general 
Request: Send a blank email to php-general+get-85161@lists.php.net to get a copy of this message
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

« previous php.general (#85161) next »