Delete all users meta that named: user_avatar
Is this what you are looking for? DELETE FROM jnkdadb7a_usermeta WHERE meta_key=’X’;
Is this what you are looking for? DELETE FROM jnkdadb7a_usermeta WHERE meta_key=’X’;
WordPress doesn’t create table on plugin activation
The $meta_value is optional and I you will be having a unique entry of prize for each user so you can just use the function without $meta_value. delete_user_meta( $userID, ‘prize’ );
Use mysql_real_escape_string() instead mysqli_real_escape_string. For more information CLICK HERE mysqli_real_escape_string ($link ,$source ) // $link is your connection variable
you have the new database selected, then run some sql updates and replacement commands on the tables notably, wp_options, wp_posts, wp_postmeta. UPDATE wp_options SET option_value = replace(option_value, ‘https://livesite.com’, ‘http://localhost/sitename’) WHERE option_name=”home” OR option_name=”siteurl”; UPDATE wp_posts SET guid = replace(guid, ‘https://livesite.com’,’http://localhost/sitename’); UPDATE wp_posts SET post_content = replace(post_content, ‘https://livesite.com’, ‘http://localhost/sitename’); UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘https://livesite.com’, … Read more
I’m not sure you can do this with MySQL alone, since you’d need to save values and reuse them. Here’s a PHP version. <?php global $wpdb; // select all the old postmeta $oldData = $wpdb->get_results(“SELECT * FROM wp_postmeta WHERE meta_key = ‘tnid_01old'”); // make sure we have results if($oldData) { // loop through each result … Read more
Plugins and themes are dependent on the database! I suggest you to: Upload the complete website. At this stage wordpress will start the usual setup from scratch. Install and activate this plugin: https://github.com/wp-sync-db/wp-sync-db Sync local db to production
I figured out the fix on my own, after many try and errors. I just change this line of code: $status = wp_create_user( $username, $password, $email ); to this: $status = wp_insert_user( array (‘first_name’ => $first, ‘last_name’ => $last, ‘user_pass’ => $password, ‘user_login’ => $username, ‘user_email’ => $email, ‘phone’ => $user_phone, ‘role’ => ‘subscriber’ ) … Read more
Here’s the solution guys, Steve from SkyVerge helped me figure it out, sorry for no editing it’s 2am and i’m super tired: Hi Steve, It looks like the problem is now fixed.I t was not necessary to change the ‘allow guest login’ as the problem was something else in the end. After much figuring out … Read more
Improving performance of SQL sub-queries in WordPress