VBulletin Create Search Table

This took me quite a while to find. Here is the query to use in MySql to create the search table in VBulletin. To find the code to create other tables in VBulletin database go to your VB upload files to: install/mysql-schema.php

This was in response to an INVALID SQL error in VB 4.0 where “domainname” is the name of your website url:
MySQL Error   : Table ‘domainname.search’ doesn’t exist
Error Number  : 1146

You may also visit this thread at VBulletin.com:

http://www.vbulletin.com/forum/showthread.php?318389-Search-function-problem&highlight=CREATE+TABLE+search

Here is the code to create the search table:

CREATE TABLE search (
searchid INT UNSIGNED NOT NULL AUTO_INCREMENT,
userid INT UNSIGNED NOT NULL DEFAULT ‘0’,
ipaddress CHAR(15) NOT NULL DEFAULT ”,
personal SMALLINT UNSIGNED NOT NULL DEFAULT ‘0’,
query VARCHAR(200) NOT NULL DEFAULT ”,
searchuser VARCHAR(200) NOT NULL DEFAULT ”,
forumchoice MEDIUMTEXT,
prefixchoice MEDIUMTEXT,
sortby VARCHAR(200) NOT NULL DEFAULT ”,
sortorder VARCHAR(4) NOT NULL DEFAULT ”,
searchtime float NOT NULL DEFAULT ‘0’,
showposts SMALLINT UNSIGNED NOT NULL DEFAULT ‘0’,
orderedids MEDIUMTEXT,
announceids MEDIUMTEXT,
dateline INT UNSIGNED NOT NULL DEFAULT ‘0’,
searchterms MEDIUMTEXT,
displayterms MEDIUMTEXT,
searchhash VARCHAR(32) NOT NULL DEFAULT ”,
titleonly SMALLINT UNSIGNED NOT NULL DEFAULT ‘0’,
completed SMALLINT UNSIGNED NOT NULL DEFAULT ‘1’,
PRIMARY KEY (searchid),
UNIQUE KEY searchunique (searchhash, sortby, sortorder)
);

One thought on “VBulletin Create Search Table

Leave a Reply

Your email address will not be published. Required fields are marked *