Success message for table creation
-
Hey, I have a plugin that creates a new table in the wordpress database. It is installed by browsing to a install.php file provided in the plugin. But how it is now, it will just give you a blank page if it installed correctly, and if it didn’t then it will throwup mysql errors. I’d like it to give a little “successfully installed” message.
// Create table
$sql[] = "CREATE TABLE ".$table_prefix."liveshoutbox (".
"id mediumint(9) NOT NULL AUTO_INCREMENT, ".
"time int(11) NOT NULL, ".
"name tinytext NOT NULL, ".
"text text NOT NULL, ".
"UNIQUE KEY id (id))";// Run the query
foreach($sql as $query) {
$wpdb->query($query);
}There is my installation code. I’ve tried wrapping it in all sorts of if statements, but none of them turn up anything. I also looked through wordpress’s install.php file to see if there was anything I could use, but I didn’t find anything. Any ideas?
- The topic ‘Success message for table creation’ is closed to new replies.