The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
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) Code:
<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>
thanks for your help |
|
#2
|
|||
|
|||
|
Remove the hide_errors, so you can see what goes wrong. But my guess is that you will receive a message that the column 'threadid' is not known.
|
|
#3
|
|||
|
|||
|
hmm possibly if someone could post how it is suppost to be done that would be creat
|
|
#4
|
||||
|
||||
|
Just download a mod that adds a table and you will see how it's done. I would guess a mod like the arcade would add a table.
|
|
#5
|
|||
|
|||
|
How what is supposed to be done?
You have at least 1 error in the query as you are defining a KEY for a column that doesn't exist. |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|