Code:
Invalid SQL:
SELECT post.*, thread.*, post.iconid AS miconid, post.attach,
icon.title as icontitle, icon.iconpath,
attach.dateline AS attachdate, attach.thumbnail_dateline, attach.filename, attach.filesize, attach.visible AS attachvisible,
attach.attachmentid, attach.counter,
IF(attach.thumbnail_filesize > 0, 1, 0) AS hasthumbnail, attach.thumbnail_filesize,
attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow,
user.lastactivity, user.lastvisit, user.options, user.usertitle, user.homepage,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, user.usergroupid,
user.membergroupids
FROM tmc_thread AS thread
LEFT JOIN tmc_post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN tmc_icon AS icon ON (post.iconid = icon.iconid)
LEFT JOIN tmc_attachment AS attach ON(attach.postid = post.postid)
LEFT JOIN tmc_attachmenttype AS attachmenttype USING (extension)
LEFT JOIN tmc_user AS user ON (post.userid = user.userid)
WHERE thread.forumid = 35
AND visible IN (0,1,2)
ORDER BY thread.dateline DESC
LIMIT 0,10;
MySQL Error : Column 'visible' in where clause is ambiguous
Error Number : 1052
Date : Sunday, March 25th 2007 @ 08:13:25 PM
Script : -----------------/forums/news.php?f=35
Referrer : -----------------/forums/showthread.php?t=238&goto=nextnewest
I obscured the URL if you're wondering why there are crazy dashes.