MySQL Forums
Forum List  »  Other Migration

MySQL 4 to MySQL 5 - SQL syntax question.
Posted by: Matthew Good
Date: September 08, 2006 07:46AM

Hello everyone. I'm helping my company migrate an older php/mysql app to a new machine, and they are upgrading to MySQL 5 from the older MySQL 4. Of course, MySQL 5 requires much more strict syntax, so something like:

...FROM table1, table2 LEFT JOIN table3...

...does not work. i've changed about 30 of these already. I've just got one query left that I'm not sure how I should change it or what it's doing...

SELECT i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, c.cat_name, u.user_name
FROM IMAGES_TABLE i, CATEGORIES_TABLE c
LEFT JOIN USERS_TABLE u ON u.user_id = i.user_id
WHERE i.image_id = 5

How is table i related to table c? With all the other queries, there was something in the where clause like "i.id = c.id" that obviously linked them together, but not this time. More importantly, how can I rewrite this so that MySQL 5 will accept it?

Thanks for the help.

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL 4 to MySQL 5 - SQL syntax question.
11038
September 08, 2006 07:46AM


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.