PDA

View Full Version : Help me : Database error


pdiscus
02-13-2013, 11:27 AM
Hi
I constantly get emails sent to my email database error

Database error in vBulletin 4.2.0:

Invalid SQL:

SELECT thread.threadid, thread.title, thread.lastpost, thread.forumid, thread.replycount, thread.postusername, thread.postuserid, thread.lastposter, thread.lastposterid, thread.dateline, thread.views, thread.visible, thread.open, user.usergroupid, user.displaygroupid
FROM thread AS thread
LEFT JOIN user AS user ON (user.userid = thread.lastposterid)
WHERE NOT ISNULL(thread.threadid) AND thread.visible = '1' AND thread.open!='10' AND thread.forumid NOT IN(3,1,2,282,272,243,245,244,508,296,573,)
ORDER BY lastpost DESC
LIMIT 0, 10;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
ORDER BY lastpost DESC
LIMIT 0, 10' at line 4
Error Number : 1064
Request Date : Wednesday, February 13th 2013 @ 07:16:52 AM
Error Date : Wednesday, February 13th 2013 @ 07:16:52 AM
Script : http://p30pji.ir/forumdisplay.php?f=70
Referrer :
IP Address : 178.252.189.217
Username : ثبت نام نشده
Classname : vB_Database
MySQL Version :


Thank you

LifesGreatestGift
02-13-2013, 03:24 PM
is this a custom script or the default vbulletin?

squidsk
02-13-2013, 04:48 PM
Hi
I constantly get emails sent to my email database error

Database error in vBulletin 4.2.0:

Invalid SQL:

SELECT thread.threadid, thread.title, thread.lastpost, thread.forumid, thread.replycount, thread.postusername, thread.postuserid, thread.lastposter, thread.lastposterid, thread.dateline, thread.views, thread.visible, thread.open, user.usergroupid, user.displaygroupid
FROM thread AS thread
LEFT JOIN user AS user ON (user.userid = thread.lastposterid)
WHERE NOT ISNULL(thread.threadid) AND thread.visible = '1' AND thread.open!='10' AND thread.forumid NOT IN(3,1,2,282,272,243,245,244,508,296,573,)
ORDER BY lastpost DESC
LIMIT 0, 10;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
ORDER BY lastpost DESC
LIMIT 0, 10' at line 4
Error Number : 1064
Request Date : Wednesday, February 13th 2013 @ 07:16:52 AM
Error Date : Wednesday, February 13th 2013 @ 07:16:52 AM
Script : http://p30pji.ir/forumdisplay.php?f=70
Referrer :
IP Address : 178.252.189.217
Username : ثبت نام نشده
Classname : vB_Database
MySQL Version :


Thank you
You have an extra , at the end of the where line. I've highlighted it below.

SELECT thread.threadid, thread.title, thread.lastpost, thread.forumid, thread.replycount, thread.postusername, thread.postuserid, thread.lastposter, thread.lastposterid, thread.dateline, thread.views, thread.visible, thread.open, user.usergroupid, user.displaygroupid
FROM thread AS thread
LEFT JOIN user AS user ON (user.userid = thread.lastposterid)
WHERE NOT ISNULL(thread.threadid) AND thread.visible = '1' AND thread.open!='10' AND thread.forumid NOT IN(3,1,2,282,272,243,245,244,508,296,573,)
ORDER BY lastpost DESC
LIMIT 0, 10;

LifesGreatestGift
02-13-2013, 04:49 PM
I noticed that as well, was just wondering if it were a custom mod query or default vBulletin as it says the file is forumdisplay. not to say they arent using a hook inside forumdisplay, just the query seemed somewhat normal.