MySQL Forums
Forum List  »  PHP

Re: Syntax Error - Syntax for 'LIMIT 1'
Posted by: Aurelien Marchand
Date: April 11, 2012 07:55AM

The cause is simple: $subject_id is empty
So when the PHP code is parsed, MySQL sees the following query:

SELECT * FROM subjects WHERE id= LIMIT 1

which is obviously wrong. As a proof, add:

echo $query . "\n";

somewhere before running the query. You'll see what I mean.


Edited 1 time(s). Last edit at 04/11/2012 07:58AM by Aurelien Marchand.

Options: ReplyQuote

Written By
Re: Syntax Error - Syntax for 'LIMIT 1'
April 11, 2012 07:55AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.