homepage Welcome to WebmasterWorld Guest from 54.166.108.167
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
simple sql left join problem
snehula




msg:4325506
 3:29 pm on Jun 13, 2011 (gmt 0)

Can anybody see why I'm getting the error:
#1064 - 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 'order LEFT JOIN product ON order.idProduct = product.idProduct WHERE order.idCus' at line 1


with the following query:

SELECT product.product_name, product.product_type, order.order_status, order.order_date, order.order_desc
FROM order LEFT JOIN product ON order.idProduct = product.idProduct
WHERE order.idCustomer = 21
ORDER BY order.order_date


when all the field names and table names are right?

 

coopster




msg:4325535
 4:41 pm on Jun 13, 2011 (gmt 0)

"order" is a reserved word in MySQL.
[dev.mysql.com...]

rocknbil




msg:4325548
 4:57 pm on Jun 13, 2011 (gmt 0)

Right, backtick `` (not quote) table and field names.

snehula




msg:4325650
 8:43 pm on Jun 13, 2011 (gmt 0)

thanx a mil :-)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved