PDA

View Full Version : Database problems


RoC wonko
08-11-2012, 08:55 AM
Can anyone tell me how to rebuild this table, bear in mind I no next to nothing about databases, I have access to myphpadmin.

Database error in vBulletin 4.2.0:

Invalid SQL:

SELECT m.*,
d.firstpostid,
fp.title as discussiontitle,
fp.postuserid as discussionuserid,
fp.postusername as discussionusername,
fp.dateline as discussiondateline
FROM groupmessage AS m JOIN discussion d ON m.discussionid = d.discussionid JOIN groupmessage fp ON d.firstpostid = fp.gmid
WHERE m.gmid >= 0 AND m.gmid <= 0;

MySQL Error : Table 'reignofc_vb.discussion' doesn't exist
Error Number : 1146
Request Date : Saturday, August 11th 2012 @ 03:42:25 AM
Error Date : Saturday, August 11th 2012 @ 03:42:26 AM
Script : http://www.reign-of-chaos.co.uk/admincp/misc.php?do=doindextypes&startat=0&pp=250&autoredirect=1&doprocess=0&totalitems=0&indextypes=0
Referrer : http://www.reign-of-chaos.co.uk/admincp/misc.php?do=doindextypes&startat=0&pp=250&autoredirect=1&doprocess=0&totalitems=0&indextypes=0

ForceHSS
08-11-2012, 11:36 AM
You are missing the table you need add it

RoC wonko
08-11-2012, 11:57 AM
You are missing the table you need add it
yep guessed that:D what I need help wise, is instructions on how to add the table how many columns etc

borbole
08-11-2012, 01:01 PM
yep guessed that:D what I need help wise, is instructions on how to add the table how many columns etc

You can copy the structure of that table from the mysql-schema.php file in the install folder. Or if you have a recent back with that table in it, extract it from there.

RoC wonko
08-11-2012, 01:47 PM
You can copy the structure of that table from the mysql-schema.php file in the install folder. Or if you have a recent back with that table in it, extract it from there.

ok found the info needed but am struggling to build the table, get syntax error

$schema['CREATE']['query']['discussion'] = "
CREATE TABLE " . TABLE_PREFIX . "discussion (
discussionid INT unsigned NOT NULL auto_increment,
groupid INT unsigned NOT NULL,
firstpostid INT unsigned NOT NULL,
lastpostid INT unsigned NOT NULL,
lastpost INT unsigned NOT NULL,
lastposter VARCHAR(255) NOT NULL,
lastposterid INT unsigned NOT NULL,
visible INT unsigned NOT NULL default '0',
deleted INT unsigned NOT NULL default '0',
moderation INT unsigned NOT NULL default '0',
subscribers ENUM('0', '1') default '0',
PRIMARY KEY (discussionid),
KEY groupid (groupid, lastpost)
)

do not see how to input the bottom 2 rows of info

ForceHSS
08-11-2012, 07:14 PM
Run this sql, I also uploaded the sql
This is from 4.1.12 I dont have 4.2 installed so check first to make sure no changes to that table before using

DROP TABLE IF EXISTS `discussion`;
CREATE TABLE `discussion` (
`discussionid` int(10) unsigned NOT NULL auto_increment,
`groupid` int(10) unsigned NOT NULL,
`firstpostid` int(10) unsigned NOT NULL,
`lastpostid` int(10) unsigned NOT NULL,
`lastpost` int(10) unsigned NOT NULL,
`lastposter` varchar(255) NOT NULL,
`lastposterid` int(10) unsigned NOT NULL,
`visible` int(10) unsigned NOT NULL default '0',
`deleted` int(10) unsigned NOT NULL default '0',
`moderation` int(10) unsigned NOT NULL default '0',
`subscribers` enum('0','1') default '0',
PRIMARY KEY (`discussionid`),
KEY `groupid` (`groupid`,`lastpost`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;