MySQL Forums
Forum List  »  PHP

nested select statement syntax error
Posted by: - lrt
Date: July 14, 2005 11:38AM

I've been developing a PHP requisition form on my localhost. My localhost is running MySQL 4.1.9 and PHP 5.0.3.

After moving everything into production, I noticed I was getting a syntax error in one of the SQL statements in my PHP code. The production server is running MySQL 3.23.58 and PHP 4.2.2.

On my localhost the SQL statement runs fine. In production I get the syntax error.

Select statement:
SELECT * FROM pur_order WHERE pur_order.req_id = (SELECT pur_item.req_id FROM pur_item WHERE pur_item.account_number = '12345' LIMIT 1);

Error message:
You have an error in your SQL syntax near 'SELECT pur_item.req_id FROM pur_item WHERE pur_item.account_number = '1212' LIMI' at line 2

Any help on this would be greatly appreciated. I always have to cross my fingers everytime I move code to a different box :(

- lrt

Options: ReplyQuote




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.