PDA

View Full Version : Database error


bosanci28
05-22-2015, 07:25 PM
Hello,

I am getting some emails with "Database error" message from my forum and not really sure why!

This is what i get:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Database error in vBulletin 4.2.2:

Invalid SQL:
SELECT location, badlocation FROM session WHERE userid = n AND lastactivity > 0 ORDER BY lastactivity DESC LIMIT 1;

MySQL Error : Unknown column 'n' in 'where clause'
Error Number : 1054
Request Date : Wednesday, May 20th 2015 @ 10:36:02 PM
Error Date : Wednesday, May 20th 2015 @ 10:36:03 PM
Script : forum link it is in here....(deleted by me)
Referrer :
IP Address : xxx.xx.xxx.xxx
Username : Unregistered
Classname : vB_Database
MySQL Version :

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Ip address is changed all the time,in every email ! so i guess there are from different people.

Thank for any advice on this.
B.

Lynne
05-22-2015, 07:27 PM
How can you have a userid of "n"? "n" is a letter, not a number and the userid must be a number.

bosanci28
05-22-2015, 07:52 PM
Hmm, i am not sure whats with the "n" in there as is not in the user groups.

MarkFL
05-22-2015, 09:08 PM
I would guess it is a "Who's Online" related query...have you recently installed any new add-ons that report user location or activity of any kind?

ForceHSS
05-22-2015, 09:19 PM
The Script part of the error can you post it we need to see what script caused the error

bosanci28
05-22-2015, 09:50 PM
See attached , i did installed quite few mods as my forum is new and getting started.
But i suspect maybe is the mod: "member tracking" but not sure.

ETS|LuucEarth
05-22-2015, 09:51 PM
My guess is that the n should be a variable $n or something along that line. Depends on the script that is calling this Query.

ForceHSS
05-22-2015, 10:01 PM
Disable plugins via config if this fixes the problem enable plugins again via config, then disable one plugin at a time until you find the problem one

To temporarily disable the plugin system, edit includes/config.php and add this line right under <?php

define('DISABLE_HOOKS', true);To enable plugins again just comment out the line
//define('DISABLE_HOOKS', true);Use notepad++ (http://notepad-plus-plus.org/download/v6.6.8.html) to edit any files

bosanci28
05-24-2015, 02:34 AM
Thank you to all for helping!

Okay, So i have disabled , that plugin "Member Tracking" and today i still got about 6 emails with the same message .

So i have i disabled all plugins via config.php and now will give it a day or two to see if the error
comes back.

Thank you.
B.

Lynne
05-24-2015, 08:03 PM
If you get the error again, can you please include the Script and Referrer so we can see what script and page the error is coming from.

bosanci28
05-25-2015, 01:40 AM
So is all most 24 hr's , from the time i have disabled all the plugins, and my last email that i got
regarding the database error was 05/23/2015 @ 5:58pm. So at this point i don't think is the script i guess. But will try to enable the mods one by one and see.

ForceHSS
05-25-2015, 08:03 AM
If you want help please follow what post 10 is asking