dxlwebs
07-20-2009, 08:26 AM
hey all first i would like to say sorry for this dumb question but im creating a feature for my mod and my wife is due to give birth tomorrow and for some reason my mind is just blank when it comes to mysql today but i have to finish this today before the baby is born!
basically what i want to do is creat a new table! here's what i have written!(or can remember)
<installcode><![CDATA[
$db->hide_errors();
$vbulletin->db->query_write("
CREATE TABLE IF NOT EXISTS `". TABLE_PREFIX ."table1 `(
`test` smallint(6) unsigned NOT NULL auto_increment,
`test2` varchar(250) collate latin1_general_ci NOT NULL,
`test3` varchar(250) collate latin1_general_ci NOT NULL,
`test4` tinyint(1) NOT NULL default '0',
`test5` tinyint(1) unsigned NOT NULL,
`test6` int(10) unsigned NOT NULL,
`test7` smallint(6) unsigned NOT NULL,
PRIMARY KEY (`test`),
KEY `threadid` (`threadid`)
) ENGINE=MyISAM ");]]></installcode>
<uninstallcode><![CDATA[$vbulletin->db->query_write("DROP table " . TABLE_PREFIX . "table1");]]></uninstallcode>
if some one could please remind me what to do that would be great i really can't believe how i have forgotten what to do! but basically what i have written doesnt seem to write any tables at all!
thanks for your help
basically what i want to do is creat a new table! here's what i have written!(or can remember)
<installcode><![CDATA[
$db->hide_errors();
$vbulletin->db->query_write("
CREATE TABLE IF NOT EXISTS `". TABLE_PREFIX ."table1 `(
`test` smallint(6) unsigned NOT NULL auto_increment,
`test2` varchar(250) collate latin1_general_ci NOT NULL,
`test3` varchar(250) collate latin1_general_ci NOT NULL,
`test4` tinyint(1) NOT NULL default '0',
`test5` tinyint(1) unsigned NOT NULL,
`test6` int(10) unsigned NOT NULL,
`test7` smallint(6) unsigned NOT NULL,
PRIMARY KEY (`test`),
KEY `threadid` (`threadid`)
) ENGINE=MyISAM ");]]></installcode>
<uninstallcode><![CDATA[$vbulletin->db->query_write("DROP table " . TABLE_PREFIX . "table1");]]></uninstallcode>
if some one could please remind me what to do that would be great i really can't believe how i have forgotten what to do! but basically what i have written doesnt seem to write any tables at all!
thanks for your help