get_charset_collate(); require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); // Require to use dbDelta include('settings.php'); // Load the files to get the databse info if( $wpdb->get_var("SHOW TABLES LIKE '{$yydev_redirect_table_name}' ") != $yydev_redirect_table_name ) { // The table we want to create doesn't exists $sql = "CREATE TABLE " . $yydev_redirect_table_name . "( id INTEGER(11) UNSIGNED AUTO_INCREMENT, name VARCHAR (500), slug VARCHAR (500), PRIMARY KEY (id) ) $charset_collate;"; dbDelta($sql); } // if( $wpdb->get_var("SHOW TABLES LIKE '{$yydev_redirect_table_name}' ") != $yydev_redirect_table_name ) { // Creating the secondary database table if( $wpdb->get_var("SHOW TABLES LIKE '{$yydev_secondary_table_name}' ") != $yydev_secondary_table_name ) { // The table we want to create doesn't exists $sql = "CREATE TABLE " . $yydev_secondary_table_name . "( id INTEGER(11) UNSIGNED AUTO_INCREMENT, secondary_id INTEGER (11), position FLOAT, request_url TEXT, destination_url TEXT, redirect_type INTEGER, advertising_platform TEXT, redirects_amount INTEGER NOT NULL, PRIMARY KEY (id) ) $charset_collate;"; dbDelta($sql); } // if( $wpdb->get_var("SHOW TABLES LIKE '{$yydev_secondary_table_name}' ") != $yydev_secondary_table_name ) {