View Full Version : database error....for a hack...

25 Nov 2002, 23:56
Okay, not sure how to describe this...nor how to fix it. :banana:

I have several special hacks on my board that were installed by various helpers from here and vb.com.

This particular hack has been no problem for any upgrade. With this upgrade there is apparently something that messing up in the script.

We have special usergroups. While the registered users are "regular members" these special usergroups (we call jewels) are levels of donors.

Crown Jewels

Each of these groups get special privileges. Avatars for one.

All of their group specialites seem to be working.

However here is where the glitch comes in:

We have a hack that is a page the displays these crown jewels. It is a hack that KIER wrote for displaying mod groups back before this function was added to the VB)

CLick on this link and it takes you to a page that is based on templates, a crown.php file .....

I have the link to view these JEWELS in every header of the VB and on my content pages.

However since the upgrade last week, whenever anyone clicks on the link, we are getting an error:

Database error in vBulletin 2.2.8:

Invalid SQL:
user.*, userfield.*, session.userid AS sessionuserid, session.lastactivity
,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.usergroupid IN(50,51,34)
GROUP BY user.username
ORDER BY user.userid

mysql error:

mysql error number: 0

Date: Monday 25th of November 2002 05:42:02 PM
Script: http://www.hystersisters.com/vb2/vb2/crown.php
Referer: http://www.hystersisters.com/vb2/forumdisplay.php?s=&forumid=5

The odd thing...is that the link is:

http://www.hystersisters.com/vb2/crown.php in all the headers (I didn't accidently put vb2 in their twice.)

while the error shows /vb2/vb2/

Remembering I'm PHP-challenged, is there someplace I can check to find this error?

I'm attaching the crown.php file for you to see:

Code is only visible to licensed users, and only when logged into the forums.

Thanks for any help you can provide.


26 Nov 2002, 00:09
Another error:

Database error in vBulletin 2.2.8:

Invalid SQL:
SELECT DISTINCT privatemessage.*, user.username AS tousername, user.emailonpm, user.invisible,
user.lastactivity, icon.iconpath, session.userid AS sessionuserid
FROM privatemessage
LEFT JOIN user ON (user.userid = privatemessage.touserid)
LEFT JOIN icon ON (icon.iconid = privatemessage.iconid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
WHERE fromuserid=27814
AND folderid <> -1
AND receipt > 0
AND dateline >= 1038092807
ORDER BY dateline DESC
mysql error:

mysql error number: 0

Date: Monday 25th of November 2002 06:06:47 PM
Script: http://www.hystersisters.com/vb2/vb2/private2.php?daysprune=
Referer: http://www.hystersisters.com/vb2/private.php

Now its other things as well....

Any idea why the path is adding an extra vb2/ to the path?? :eek:

26 Nov 2002, 00:40
Check in the Admin CP that $bburl (the boards url) is set correctly and that you don't have the directory name twice there.

26 Nov 2002, 00:42
I checked and I don't. All other functions are fine. Replies and threads, forums and so on....

I'm putting in a ticket at VB.com I guess....

26 Nov 2002, 03:34
The repeating forum directory is just a by-product of the SQL error - ignore that.

The problem is the query - I had a similar problem in my admin user.php and mod user.php - it is to with the query looking for non-custom avatars. For the life of me I cannot remember what I did to fix it...

It's to do with newer versions of vB not liking certain older queries. That doesn't explain your private.php error though, unless you didn't update it completely.

When I have time I will look it up for you.

26 Nov 2002, 03:41
Thanks guys. Just an update...I found the culprit. Not VB at all....but a too full server. /usr was so full it couldn't handle even writing correct error logs (thus the error=0 in the error message)

My server holds 16 gig and yet we had it at capacity with the vb of ours. Its not the first time a full server did funky things to the processes of the vb...and each time I forget about this kind of behavior. (Each time its a bit different in its symptoms)

We recently upgraded and had additional backups of the database...somewhere between 1-2 gig in size. :eek:

So...we deleted two backups and *poof* we are in business again and my hacks are all functional again and the other postings.php and private2.php are now working fine.

Thanks sooo much for ya'lls help. (And thanks to Logician who found my server tooooo full as the answer)

Any idea if adding a hard drive to my server would help with storage space on a rapidly growing database? :-) (I even prune inactive members monthly.)