Re: MySQL Query not working via PHP

From: Date: Sat, 18 Oct 2003 09:34:12 +0000
Subject: Re: MySQL Query not working via PHP
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-31117@lists.php.net to get a copy of this message
remove the comma after cadet.photo, ie select ........cadet.relation2,cadet.photo FROM .... HTH steve Matthew Moldvan, Jr. wrote:
I would say try single quotes instead of double quotes ... let me know if that works ... Regards, Matt. ----- Original Message ----- From: "Sean Smitz" <stsmitz@comcast.net> To: <php-db@lists.php.net> Sent: Friday, October 17, 2003 4:32 PM Subject: [PHP-DB] MySQL Query not working via PHP
I have a query that works in MySQL but when I try to execute it in PHP I encounter the following error: //Generated by the script Couldn't execute query! // Generated by MySQL MySQL reports: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM cadet, cadet_phone WHERE cadet.ssn = cadet_phone.ssn AND ( //Query outputted by the script Query was: SELECT cadet.rank, cadet.lname, cadet.fname, cadet.mname, cadet.address1, cadet.address2, cadet.city, cadet.state, cadet.zipcode, cadet.email, cadet.guardian1, cadet.relation1, cadet.guardian2, cadet.realtion2, cadet.photo, FROM cadet, cadet_phone WHERE cadet.ssn = cadet_phone.ssn AND (cadet.lname = "Smith" AND cadet.fname = "John" AND cadet.mname = "Doe") Attached is the entire page. Any help is appreciated. Sean Smitz -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.db (#31117) next »