Forum Moderators: coopster
<?phprequire "./global.php";
if($mybb['uid'] == 0)
{
nopermission();
}$sql = "CREATE TABLE `".TABLE_PREFIX."whatever` (
`did` smallint(6) NOT NULL auto_increment,
`cid` smallint(6) NOT NULL default '0',
`uid` smallint(6) NOT NULL default '0',
`name` varchar(32) NOT NULL default '',
`description` text NOT NULL,
`url` varchar(200) NOT NULL default '',
`visible` char(3) NOT NULL default '',
`sticky` char(3) NOT NULL default '',
`validated` char(3) NOT NULL default '',
PRIMARY KEY (`did`)
) TYPE=MyISAM AUTO_INCREMENT=1;";$query = $db->query($sql);
echo "<font face=\"arial\" size=\"2\" color=\"green\"><b>Table Added:</b> forumlinks</font><br />\n";echo "<br />\n<br />\n";
echo "<font face=\"arial\" size=\"2\" color=\"green\"><b>Installation Complete!</b><br />Please delete this file now for security reasons.</font>\n";?>
Notice the bold line, that basically creates the new table. Instead of this script creating a table, I would like this script to insert into the specified table that already exists (my example is "whatever"). What can I change in this script to make it insert sql into a pre-existing table? Thanks!
Does this table already have data in it?