You have to fetch the row that contains the count in it. Try this: $resource = mysql_query("SELECT COUNT(*) cnt FROM catalogs WHERE PROCESSED IS NULL"); $countreq = mysql_fetch_array($resource); echo $countreq[cnt];
(note as well that if no row is returned by the query then $countreq will be set to false, so checking that before using it as an array is a good idea) - Patrick ----- Original Message ----- From: "James Kupernik" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 18, 2002 12:05 PM Subject: [PHP-DB] Resource id #2 ? > I run this query $countreq = mysql_query("SELECT COUNT(*) FROM catalogs > WHERE PROCESSED IS NULL"); then try to echo $countreq but end up getting > Resource id #2 instead of the count total. What would cause this? > > Thanks for any advise! > > James > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]