Last active
November 5, 2015 17:14
-
-
Save Dinamiko/8cfdfee822ebf885bacb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Crea la tabla encuesta en la base de datos o la actualiza | |
*/ | |
function encuesta_database_install() { | |
global $wpdb; | |
$table_name = $wpdb->prefix . 'encuesta'; | |
$sql = "CREATE TABLE $table_name ( | |
id mediumint(9) NOT NULL AUTO_INCREMENT, | |
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, | |
respuesta VARCHAR(30) DEFAULT '' NOT NULL, | |
email VARCHAR(100) DEFAULT '' NOT NULL, | |
UNIQUE KEY id (id) | |
);"; | |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); | |
dbDelta( $sql ); | |
update_option( "encuesta_db_version", ENCUESTA_BBDD_VERSION ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment