wpdb syntax error?
-
I get a syntax error on the insert query but I have no idea why.
The reason why I am trying to make a new table it a long story but there is no other way to solve my problem.
I’ve been at this for a while and the moment I enable the wpdb line it throws an error. But I think that the line is probably not the problem.
global $wpdb; $charset_collate = $wpdb->get_charset_collate(); $table_name = "vuora_mu_blog_id"; $sql = "CREATE TABLE IF NOT EXISTS $table_name ( id mediumint(9) NOT NULL AUTO_INCREMENT, blogname VARCHAR(50) NOT NULL, blogid mediumint(9), UNIQUE KEY id (id) ) $charset_collate;"; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); dbDelta( $sql ); $site_details = get_blog_details(); $my_blogname = $site_details->blog_id; $my_blogid = $site_details->blogname; $wpdb->insert($table_name, array('blogname'=>$my_blogname, 'blogid'=>$my_blogid);
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘wpdb syntax error?’ is closed to new replies.