PDA

View Full Version : SQL errors


KimmiKat
04-10-2005, 09:35 AM
I installed the hack and I get this when I hit "View Warned Users"

Database error in vBulletin 3.0.7:

Invalid SQL: SELECT COUNT(*) AS users FROM user AS user where warnings>0
mysql error: Unknown column 'warnings' in 'where clause'

mysql error number: 1054

And the following when I try to unban a user...

Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT user.userid, user.username, user.posts, user.warning_bans,
userban.usergroupid, userban.displaygroupid, userban.customtitle, userban.usertitle,
IF(userban.userid, 1, 0) AS banrecord,
IF(usergroup.genericoptions & 32, 1, 0) AS isbannedgroup
FROM user AS user
INNER JOIN usergroup AS usergroup ON(usergroup.usergroupid = user.usergroupid)
LEFT JOIN userban AS userban ON(userban.userid = user.userid)
WHERE user.userid = 148

mysql error: Unknown column 'user.warning_bans' in 'field list'

mysql error number: 1054

I've been scratching my head and can't figure it out.

Thanks

sv1cec
04-10-2005, 11:20 AM
Well, obviously your user table does not have the needed columns.

Run this query:

describe user

Check that the following columns are defined:

`warnings` int(5) default '0'
`warning_level` int(15) default '0'
`warning_bans` int(2) default '0'

If they are not defined (why?), add them using the following query:

ALTER TABLE `".TABLE_PREFIX."user`
add `warnings` int(5) default '0',
add `warning_level` int(15) default '0',
add `warning_bans` int(2) default '0'

Remember to change the Table Prefix if you are using one.

Rgds

KimmiKat
04-10-2005, 05:46 PM
This is going to sound dumb, but what is a "table Prefix?" My co-admin (who knows this stuff) started this modification before she left and I am so lost since I can't get a hold of her for help.

sv1cec
04-11-2005, 06:01 AM
It's a prefix that is used in front of every table name. For example, in some installations, where the admin didn't want to leave the default naming alone, he may have added a table prefix like "vb_", in which every table in his database would start with those three letters. In other words, his user table will no longer be named user, but vb_user.

Rgds

KimmiKat
04-11-2005, 06:04 PM
Thanks! I wasn't sure since my former co-admin did most of the work on the board.

sv1cec
04-12-2005, 08:45 AM
No problem.