Invalid Query?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Invalid Query?

Post by malcolmboston »

Code: Select all

SELECT *
FROM `products`
WHERE `productCategoryID` = '1'
AND `productOnline` = '1'
ORDER BY `productCategoryID` DESC 
Error Reporting wrote: 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 'AND `productOnline` = 1' at line 4
Works in PHPmyAdmin, wont work in PHP, any ideas :cry:
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Works for me with both.
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Have you echoed the query from PHP?
Post Reply