Parsing Error

From: Date: Sun, 08 Jul 2001 01:22:37 +0000
Subject: Parsing Error
Groups: php.db 
Request: Send a blank email to php-db+get-10143@lists.php.net to get a copy of this message
I keep getting the following error: Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/stats/jobs/listing.php on line 33 Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/stats/jobs/listing.php on line 43 when I try to display the following webpage. What am I doing wrong? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> <html> <head> <title>Title</title> </head> <body> <?php $hostName="localhost"; $userName="jeff"; $password="jeff"; $databaseName="jobs"; $tableName="listings"; // connnect to the database if (!($link=mysql_pconnect($hostName, $userName, $password))) { DisplayErrMsg(sprintf("error connecting to host %s by user %s", $hostName, $userName)); exit(); } // select the database if (!mysql_select_db($databaseName, $link)) { DisplayErrMsg(sprintf("Error in selecting %s database", $databaseName)); DisplayErrMsg(sprintf("error:%d %s", mysql_errno($link), mysql_error($link))); exit(); } // send the SQL queries $result=mysql_query("SELECT * FROM listings WHERE store='West Covina', $link"); // return how many rows $num_rows=mysql_num_rows($result); // check if greater than zero if($num_rows!=0) { printf("<FONT SIZE=+3>West Covina</FONT> <FONT SIZE=-2><I><A HREF=\"../test/stores.php#WC\">address</A></I></FONT><BR><BR>"); while ($row=mysql_fetch_array($result)) { $store=$rowid["store"]; $jobdesc=$rowid["jobdesc"]; printf("<A HREF=\"mailto:test@test.com?subject=$store\%20$jobdesc\">$jobdesc</A><BR>\n"); } } mysql_free_result($result); ?> </body> </html> Thank you, Jeff --- Jeff Grossman (jeff@stikman.com)

« previous php.db (#10143) next »