Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Private Messaging Extended

Ok (just asking this cause i am working on a plugin myself), but how about the next step. I have this to create a table if it doens’t excist:

bb_register_activation_hook(__FILE__, 'bbmenu_install_check');

function bbmenu_install_check() {
global $bbdb;

$bbdb->hide_errors();
$installed = $bbdb->get_results("show tables like ".$bbdb->prefix."bbmenu");

if ( !$installed ) :
$bbdb->query(" CREATE TABLE IF NOT EXISTS <code>&quot;.$bbdb->prefix.&quot;bbmenu</code> (
<code>item_id</code> INT(3) NOT NULL AUTO_INCREMENT,
<code>item</code> varchar(50) NOT NULL default '',
<code>set</code> varchar(50) NOT NULL default '',
<code>page</code> varchar(50) NOT NULL default '',
<code>location</code> varchar(50) NOT NULL default '',
<code>order</code> int(9) NOT NULL default '0',
PRIMARY KEY (<code>item_id</code>)
)");
endif;
$bbdb->show_errors();
}

But I also want to put some data in it:

"INSERT INTO$bbdb->menu` VALUES

(DEFAULT, ‘Forums’, ‘active’, ‘index.php’, ‘front-page’, 0),

(DEFAULT, ‘Search’, ‘active’, ‘search.php’, ‘search-page’, 1),

(DEFAULT, ‘Statistics’, ‘inactive’, ‘statistics.php’, ‘stats-page’, 0);”;`

How to do this in the same query?

Skip to toolbar