TeddyKiller Posted May 27, 2010 Share Posted May 27, 2010 Here is the query... $query = $db->execute("SELECT sc.comment, sc.date, u.id, u.avatar, u.username FROM `status_comment` as sc, `users` as u WHERE `u.id` = `sc.user_id` ORDER BY `sc.date` DESC"); The error I get is this.. MySQL Error on Query 'SELECT sc.comment, sc.date, u.id, u.avatar, u.username FROM `status_comment` as sc, `users` as u WHERE `u.id` = `sc.user_id` ORDER BY `sc.date` DESC': Unknown column 'u.id' in 'where clause' Is it the `'s .. but if it is, I dont see how it would be the problem? Quote Link to comment https://forums.phpfreaks.com/topic/203084-unknown-collum-uid-id-does-exist-in-table-users/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 27, 2010 Share Posted May 27, 2010 Just remove all of the back-ticks ``. Back-ticks are only needed when an identifier needs special handling (you must like typing extra characters.) If you want to use them, it would be `u`.`id`because they go around identifiers (i.e. database, table, and column names.) Quote Link to comment https://forums.phpfreaks.com/topic/203084-unknown-collum-uid-id-does-exist-in-table-users/#findComment-1064125 Share on other sites More sharing options...
-Karl- Posted May 27, 2010 Share Posted May 27, 2010 What PFMaBiSmAd said, also they're called columns, not collums! Quote Link to comment https://forums.phpfreaks.com/topic/203084-unknown-collum-uid-id-does-exist-in-table-users/#findComment-1064134 Share on other sites More sharing options...
TeddyKiller Posted May 27, 2010 Author Share Posted May 27, 2010 What PFMaBiSmAd said, also they're called columns, not collums! Dude, leave me alone :L Don't critizise my spells. You're a bully. Eat my fingers. - We'll continue this on MSN yo! Quote Link to comment https://forums.phpfreaks.com/topic/203084-unknown-collum-uid-id-does-exist-in-table-users/#findComment-1064138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.