RE: [PHP] Now, why doesn't this work (update)?

From: Date: Tue, 24 Apr 2001 02:23:52 +0000
Subject: RE: [PHP] Now, why doesn't this work (update)?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49993@lists.php.net to get a copy of this message
Also, I ran this SQL on the regular mysql client, and it returned the correct data...for some reason if I run it in PHP, I get the SQL syntax error. Tyler > -----Original Message----- > From: Tyler Longren [mailto:tyler.longren@midiowa.net] > Sent: Monday, April 23, 2001 9:20 PM > To: PHP-General > Subject: [PHP] Now, why doesn't this work? > > > Hello everybody, > > My host seems to be having some weird problems. > Here's a piece of code: > > if (($this_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE > month = '$thismonth' ORDER BY timestamp ASC")) && ($next_month_sql = > mysql_query("SELECT * FROM $mysql_shows_table WHERE month = '$nextmonth' > ORDER BY timestamp ASC"))) { > do this(); > } > else { > print ("<font face=Arial size=2>MySQL query <b>DIDN'T RETURN > DATA</b><br>Error No.:". mysql_errno(). "<br>MySQL Error:". > mysql_error(). > "</font><Br>"); > } > > Now, this is the error that I get from this: > MySQL query DIDN'T RETURN DATA > Error No.:1064 > MySQL Error:You have an error in your SQL syntax near 'WHERE month = '4' > ORDER BY timestamp ASC' at line 1 > > Why I get this, I don't know. The code hasn't changed in a few > days, and it > just started doing that today. This also works on my home Win2k box, and > Slackware box. The versions of PHP, MySQL, and apache are the same on my > host and on my Linux box. The version of php and mysql are the > same on ALL > of the machines (host, Win2k, Slackware). > > Any ideas? > > Thanks everyone, > Tyler > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#49993) next »