| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Seasoned Poster
Joined in Sep 2003
47 posts
Gave thanks: 4
Thanked 5 times
|
an sql error on mysql5 after transfer from mysql4
hello,
i have an sql sentence which was working on mysql 4. SELECT p.*, e.title, u.user FROM photos p, records e LEFT JOIN users u ON u.user=p.user WHERE p.approved=1 AND e.id=p.id but this sql sentence now gives error on mysql 5. it says: Unknown column 'p.user' in 'on clause' however there is a column named user on p table. does anybody have any idea what might be causing the this? thanks in advance
__________________
server: pass40 |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Seasoned Poster
Joined in Sep 2003
47 posts
Gave thanks: 4
Thanked 5 times
|
some google search with the error sentence gave the correct result here:
MySQL Bugs: #13551: #1054 - Unknown column 'xxxx' in 'on clause' we need to put paranthesis around from tables and join expressions: like below: ... FROM (table1, table2) join ... ON (col1=col2) incase anyone comes accross the same error.
__________________
server: pass40 |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Seasoned Poster
Joined in Aug 2006
Hosted on Pass64
62 posts
Gave thanks: 9
Thanked 0 times
|
Thank you very much, sascoms! Of all the pages I read on fixing the "joins" syntax error, your simple explanation is how I found my way!
![]()
__________________
Pass64: |
|
|
|