Log in

View Full Version : Search results in Database error (need help)


Aclikyano
03-12-2009, 08:04 PM
Whenever anyone searches, we get this error below.
It seems noone can figure it out on my end, and now were looking for those experience ppl to help us get rid or fix this problem. :(

Database error in vBulletin 3.8.1:

Invalid SQL:

SELECT post.pagetext AS preview,post.thankscache,
thread.threadid, thread.threadid AS postid, thread.title AS threadtitle, thread.iconid AS threadiconid, thread.dateline, thread.forumid,
thread.sticky, thread.prefixid, thread.taglist, thread.pollid, thread.open, thread.lastpost AS postdateline, thread.visible,
thread.hiddencount, thread.deletedcount, thread.attach, thread.postusername, thread.forumid,

thread.replycount, IF(thread.views<=thread.replycount, replycount+1, thread.views) AS views,
thread.lastpost, thread.lastposter, thread.lastpostid
,
deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,
user.userid AS postuserid


, firstpostid, attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid , attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid , attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid
FROM thread AS thread
LEFT JOIN user AS user ON(user.userid = thread.postuserid)

LEFT JOIN deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')


LEFT JOIN post AS post ON(post.postid = thread.firstpostid)

LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png'))
WHERE thread.threadid IN
(39211, 136931, 89389, 87745, 87675, 87439, 87680, 50260);

MySQL Error : Not unique table/alias: 'attachment'
Error Number : 1066
Request Date : Thursday, March 12th 2009 @ 05:01:51 PM
Error Date : Thursday, March 12th 2009 @ 05:01:51 PM
Script : http://crackmuzik.com/forums/search.php?searchid=823858
Referrer : http://crackmuzik.com/forums/search.php?do=process
IP Address : 72.200.155.29
Username : AtotheC
Classname : vB_Database
MySQL Version : 4.1.22-standard

snakes1100
03-12-2009, 08:16 PM
1. Globally disable your hacks via config.php

Try a search afterwards.

2. With the hacks still disabled, use the default vbulletin style and test again by doing a search to see if the error has gone away.

Lynne
03-12-2009, 09:19 PM
I already told you what the problem is over in your thread over on vb.com

Aclikyano
03-12-2009, 11:02 PM
I know... I also said I didnt know how to fix it, and I aint got a answer back