RE: [PHP-DB] Parsing Error

From: Date: Sun, 08 Jul 2001 02:12:07 +0000
Subject: RE: [PHP-DB] Parsing Error
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10146@lists.php.net to get a copy of this message
I don't see why you are using printf there try print instead or echo ;)0 -----Original Message----- From: Jeff Grossman [mailto:jeff@stikman.com] Sent: Saturday, July 07, 2001 6:56 PM To: php-db@lists.php.net Subject: Re: [PHP-DB] Parsing Error Thanks Larry. Now I am getting a printf too few arguments error on this line: printf("<A HREF=\"mailto:test@test.com?subject=$store\%20$jobdesc\">$jobdesc</A><BR >\n"); Thanks, Jeff "Larry Rivera" <web@ldstudio.net> wrote: >After a brief look it appears that your call to mysql_query is incorrect >" after the query then "," then the link resource > >-----Original Message----- >From: Jeff Grossman [mailto:jeff@stikman.com] >Sent: Saturday, July 07, 2001 6:23 PM >To: php-db@lists.php.net >Subject: [PHP-DB] Parsing Error > >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><B R >>\n"); > } >} >mysql_free_result($result); > >?> > ></body> ></html> > > >Thank you, >Jeff >--- >Jeff Grossman (jeff@stikman.com) --- Jeff Grossman (jeff@stikman.com) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#10146) next »