PDA


View Full Version : SQL error with Latest Topics


kall
11-28-2004, 04:14 PM
Hi..

This has just cropped up this morning, for no apparent reason (no changes by me)..


Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT

thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
L
L
L
L
FROM thread as thread
L
L
L
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
L
WHERE open <> '10' AND thread.visible = 1 AND thread.forumid NOT IN(6,13,31,54,53,30,20,11,26,24) AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC
LIMIT 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 'L
L
L
FROM thread as thread
L
L
L
LEFT JOI

mysql error number: 1064

Date: Sunday 28th of November 2004 08:41:25 AM
Script: http://nzboards.com/
Referer:

Any ideas why/how to fix it?

Zachery
11-28-2004, 05:16 PM
Have you edited any of the files recently, all thoughs l's arnt helping

kall
11-28-2004, 06:28 PM
None of the vBA files, no..

It was working fine yesterday afternoon.

Last night, I added adsense in my header. I can't see how that would have affected anything... :)

Regarding the Ls..no, they don't give a very happy impression, do they? Unfortunately, searching for "L L L L L" doesn't do much good.

Brian
11-29-2004, 12:51 AM
In your latesttopics.php file look for:
$inforums = '';

Right below that line, near the top of the file, try adding this:
$query = array();

Let me know if that makes any difference.

kall
11-29-2004, 03:41 AM
In your latesttopics.php file look for:
$inforums = '';

Right below that line, near the top of the file, try adding this:
$query = array();

Let me know if that makes any difference.
:thumbsup:

That seems to have done the trick.

What do you reckon caused it to go bungo in the first place?

*edit* Hang about....I may just be stupid...

kall
11-29-2004, 03:48 AM
Alrighty...that worked. Now I have a poll issue.


Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT thread.pollid, open, threadid, replycount, forumid, question, poll.dateline, options, votes, active, numberoptions, timeout, multiple, voters, public L
FROM thread AS thread
INNER JOIN poll AS poll USING (pollid)
L
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
WHERE open <> 10 AND thread.pollid != 0 AND visible = 1 AND deletionlog.primaryid IS NULL L
LIMIT 1

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 'L
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid =

mysql error number: 1064

Date: Monday 29th of November 2004 02:47:21 AM
Script: http://www.nzboards.com/
Referer: http://forums.nzboards.com/showthread.php?t=2137

Brian
11-29-2004, 12:06 PM
To be honest, I'm really not sure why it's doing that. There's only been one other person that's had that problem and I just noticed that each $query[] variable in the query was being replaced by an L.
If you'll open your currentpoll.php file and look for this code:
if ($mod_options['portal_poll_forumid'] == 'RAND')

And right below it add this:
$query = array();

That should fix the problem there as well.

kall
12-10-2004, 10:43 PM
Doing that gives me this error:

Parse error: parse error, unexpected T_ELSE in /home3/nzboards/public_html/forums/modules/currentpoll.php on line 19

*edit* technically, I added it after

if ($vba_options['portal_poll_forumid'] == 'RAND')

as your line wasn't there.

*edit2*

However, REPLACING $query['pollquery'] = $iforumperms . 'ORDER BY RAND()'; with what you said, that seems to have done the job. :)

Thanks guys.