PDA

View Full Version : Dreaded Mysql Error!!


MindTrix
05-22-2003, 05:45 PM
Ohh nooo i got the dreaded mysql error.

Everything was working perfect, till i deleted some members, then some posts. Soon as i did the posts i got errors.

Database error in vBulletin 2.3.0:

Invalid SQL: SELECT COUNT(attachmentid) AS total FROM attachment WHERE userid=
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 '' at line 1

mysql error number: 1064

Date: Wednesday 21st of May 2003 11:26:12 PM
Script: http://www.rapland.co.uk/forum/forum/showthread.php?threadid=12
Referer: http://www.rapland.co.uk/forum/forumdisplay.php?forumid=36

Ne ideas???

:ermm: :disappointed:

Xenon
05-22-2003, 06:37 PM
WHERE userid=

you should enter a valu behind =

MindTrix
05-22-2003, 07:35 PM
ne ideas how too go about fixin it??

MindTrix
05-23-2003, 04:58 PM
Ne one ? plzzzzzzzzzz :'(

Boofo
05-23-2003, 07:15 PM
Have you tried running update counters in the Admin CP?

MindTrix
05-23-2003, 07:26 PM
Yeah i ran them all :p and still nothing. Damn mysql :( now i cant use my forum till its fixed :S

Boofo
05-23-2003, 07:32 PM
Show us that code in your showthread.php and we'll see if we can figure it out. Is it from a hack?

MindTrix
05-23-2003, 07:40 PM
i tried like 5 times to post it, but im getting a fatal error here so i wont post the whole thing etc.

heres the jist of the error on this site

Fatal error: Maximum execution time of 15 seconds exceeded in

functions.php on line 2805

dunno if that matters. Ne wayz ill attach my file cause it wont let me post it

Boofo
05-23-2003, 07:50 PM
Take that file down, please. You are not allowed to post vb files on here.

Boofo
05-23-2003, 07:52 PM
The code you need is in the forumdisplay.php. I didn't look at the error very well the first time. Just post that query.

MindTrix
05-23-2003, 07:55 PM
my bad.soz.

this is the only part i can find that has it

$accesscache = array();
if ($bbuserinfo['userid']!=0 AND $enableaccess) {
//Access table perms
$accessperms=$DB_site->query("SELECT forumid,accessmask FROM access WHERE userid='$bbuserinfo[userid]'");
while ($accessperm=$DB_site->fetch_array($accessperms)) {
$accesscache["$accessperm[forumid]"] = $accessperm;
}
$DB_site->free_result($accessperms);
unset($accessperm);

Boofo
05-23-2003, 08:26 PM
This is where the error is:

SELECT COUNT(attachmentid) AS total FROM attachment WHERE userid=

That's what you need to find.

MindTrix
05-23-2003, 09:18 PM
its not in either showthread.php or forumdisplay.php :s odd

MindTrix
05-23-2003, 09:24 PM
i searched in functions.php and i found it

//start user attachment add By All-the-vb
global $DB_site;
$attachment = $DB_site->query_first("SELECT COUNT(attachmentid) AS total FROM attachment WHERE userid=$post[userid]");
$attachcoun = $attachment[total];
//end user attachment add By All-the-vb

so seems like its from a hack, but the code looks ok to meh

MindTrix
05-23-2003, 09:31 PM
yeahhhhhhhhh i fixed it :) i jus removewd that, cause i searched the hacks thread and turns out people got the same prob so they uninstalled it, and the author stopped postin back lol. Thanks for everything boofo at least u took the time to help