remove the comma after, ie

select ........cadet.relation2, FROM ....

HTH steve

Matthew Moldvan, Jr. wrote:

I would say try single quotes instead of double quotes ... let me know if
that works ...


----- Original Message ----- From: "Sean Smitz" <[EMAIL PROTECTED]>
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.state, cadet.zipcode,, cadet.guardian1, cadet.relation1, cadet.guardian2,
cadet.realtion2,, 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 (
To unsubscribe, visit:

Reply via email to