How to DROP TABLE from database
-
I’m working on a plugin which creates a table on activation. How do I drop that table on deactivation? Here is my code so far, but all it does is create the table, not delete it on deactivation.
...other functions and things... function POD_deactivate() { global $wpdb; //required global declaration of WP variable $table_name = $wpdb->prefix.POD_table_name; $sql = "DROP TABLE ". $table_name; $wpdb->query($sql); } register_activation_hook(__FILE__,'POD_install'); register_deactivation_hook(__('POD') , 'POD_deactivate' ); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to DROP TABLE from database’ is closed to new replies.