How to fix these SQl errors?

th2mods

New Member
When i click "go advanced" on profile visitor messages, i get this

Code:
Database error in vBulletin 3.7.2:

Invalid SQL:

			(
				SELECT
					visitormessage.*, visitormessage.dateline AS pmdateline, user.*, visitormessage.ipaddress AS messageipaddress
					,deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason
					,avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight
					,ame_flag
				FROM visitormessage AS visitormessage
				LEFT JOIN user AS user ON (visitormessage.postuserid = user.userid)
				LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)
				LEFT JOIN deletionlog AS deletionlog ON (visitormessage.vmid = deletionlog.primaryid AND deletionlog.type = 'visitormessage')
				
				WHERE visitormessage.userid = 171 AND visitormessage.postuserid = 1 AND visitormessage.state IN ('visible','moderation','deleted')
				
			)
			UNION
			(
				SELECT
					visitormessage.*, visitormessage.dateline AS pmdateline, user.*, visitormessage.ipaddress AS messageipaddress
					,deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason
					,avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight
					
				FROM visitormessage AS visitormessage
				LEFT JOIN user AS user ON (visitormessage.postuserid = user.userid)
				LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid)
				LEFT JOIN deletionlog AS deletionlog ON (visitormessage.vmid = deletionlog.primaryid AND deletionlog.type = 'visitormessage')
				
				WHERE visitormessage.userid = 1 AND visitormessage.postuserid = 171 AND visitormessage.state IN ('visible','moderation','deleted')
				
			)
			ORDER BY pmdateline DESC;

MySQL Error   : The used SELECT statements have a different number of columns
Error Number  : 1222
Request Date  : Wednesday, September 24th 2008 @ 12:25:29 AM
Error Date    : Wednesday, September 24th 2008 @ 12:25:30 AM
Script        : [color=Red]*removed[/color]*/forums/visitormessage.php?do=message
Referrer      : [color=Red]*removed[/color]*/forums/member.php?u=171
IP Address    : 75.162.229.40
Username      : Smelly taco
Classname     : vb_database
MySQL Version : 5.0.67-community

What do i insert in my SQl database?

Thanks


Amazing site! Love this site.
 
As I said this is almost certainly from an add-on. That is typical of 'Invalid SQL' errors.

To troubleshoot this, first reupload all the original vB non-image files (except install.php). Make sure you upload these in ASCII format and overwrite the ones on the server. Also be sure to upload the admincp files to whichever directory you have set in your config.php file. Then run 'Suspect File Versions' in Diagnostics to make sure you have all the original files for your version and that none show 'File does not contain expected contents':

Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions

[Note: In some cases you may also need to remove any of the listed .xml files in the includes/xml directory.]

Next, disable all plugins.

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

define('DISABLE_HOOKS', true);

Then if you still have this problem, create a new style and choose no parent style. This will force it to use the default templates. Finally empty your browser cache, close all browser windows then try again. Make sure you change to the new style and view your forums with it. Do you have the same problem?

Database error when trying to post a visitor message ! - vBulletin Community Forum
 
Back
Top