Invalid SQL:
SELECT
info_hash,
size,
comment,
created_by,
announce_list,
completed_by,
completed,
seeders,
leechers,
ulspeed,
dlspeed,
dateline,
thumbnail_dateline,
filename,
filesize,
visible,
attachmentid,
counter,
postid,
IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail,
thumbnail_filesize,
attachmenttype.thumbnail AS build_thumbnail,
attachmenttype.newwindow
FROM attachment
LEFT JOIN attachmenttype AS attachmenttype USING (extension)
WHERE postid IN (-1,2)
ORDER BY attachmentid;
MySQL Error : Column 'size' in field list is ambiguous Error Number : 1052
This means that
size
is presumably in bothattachment
andattachmenttype
.If you qualify your column names, then you won't ever have this type of problem.