Updating with $qpdb->query() always returns 0 rows affected

wpdb uses PHP’s mysqli_affected_rows() or mysql_affected_rows(), which can be disabled via an argument in php.ini. I am guessing that that is what has happened. Check the disabled_functions line in your php.ini file and remove the references to those function. Of the top of my head, I am not sure if extensions like Suhosin mess with … Read more

New post from database

With few lines of code you can transfer your data from your custom table to post table. Do some MySQL query using $wpdb Object to get data from your custom table. And then in foreach() loop use wp_insert_post and add_post_meta to add all those rows in your post table. And you are Done!

wp_usermeta – Read from database, but save function broken

You have not provided the whole code so don’t understand where you are wrong, this script is working fine for me. add_action( ‘personal_options_update’, ‘save_extra_profile_fields’ ); add_action( ‘edit_user_profile_update’, ‘save_extra_profile_fields’ ); function save_extra_profile_fields( $user_id ) { if ( current_user_can(‘edit_user’,$user_id) ) update_user_meta($user_id, ‘uidnumber’, sanitize_text_field($_POST[‘uidnumber’])); } add_action(‘show_user_profile’, ‘show_extra_profile_fields’); add_action(‘edit_user_profile’, ‘show_extra_profile_fields’); function show_extra_profile_fields( $user ) { ?> <p class=”form-row form-row-wide”> … Read more

MySQL: How to change url in posts from xxx.com to yyy.org?

Instead of replace url directly in mysql db Try with Velvet Blues Update URLs wordpress plugin. It is safe to use this plugin. Because mysql db has some serialize values for post meta key. In that case your solution will not work proper. I had used velvet blue update urls plugin many times while migrating … Read more

Migration problems with mysql: Operation not allowed when innodb_forced_recovery > 0 [closed]

Commenting out the line innodb_force_recovery = 1 in /etc/my.cnf thus: # innodb_force_recovery = 1 made the mysql innodb tables in the database accessible. Apparently this setting causes innodb to become read-only. I hope this helps someone in the future. If you don’t have access to /etc/my.cnf on shared hosting, ask your host to fix it … Read more