Log in

View Full Version : MySQL Error


Ntenze
09-24-2004, 12:05 PM
Any help would be appreciated.

Invalid SQL:
SELECT
post.*, post.username AS postusername, post.ipaddress AS ip,
NOT ISNULL(deletionlog.primaryid) AS isdeleted, i.userid AS installed,
user.*, userfield.*
, '' AS field9
FROM vb3_post AS post
LEFT JOIN vb3_user AS user ON(user.userid = post.userid)
LEFT JOIN vb3_userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN vb3_deletionlog AS deletionlog ON(post.postid = deletionlog.primaryid AND type = 'post')
LEFT JOIN vb3_hacks_install AS i ON(i.threadid=2005 AND post.userid=i.userid)
WHERE threadid = 2005 AND post.visible = 1
ORDER BY postid

mysql error: Column: 'threadid' in where clause is ambiguous

mysql error number: 1052


Thanks Ntenze

Xenon
09-24-2004, 12:07 PM
change

WHERE threadid = 2005 AND post.visible = 1

into
WHERE post.threadid = 2005 AND post.visible = 1

Ntenze
09-25-2004, 10:50 AM
Thank you Xenon. Done the trick. :)

Xenon
09-26-2004, 09:58 PM
you're welcome :)