Valid SQL query return empty

There are view issues with the query: First what the @janh wrote. Second why you removing the am/pm when you could easily use the date(“Y-m-d H:i:s”); Third, there is this little helper for the database table prefixes $wpdb->prefix Users table the column name is display_name Also when you make aliases is a good rule to …

Read more

Same database; different WordPress

You need to set the WP_SITEURL and WP_HOME in domainB.com’s wp-config.php file. Please add below code. define(‘WP_SITEURL’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); define(‘WP_HOME’, ‘http://’ . $_SERVER[‘HTTP_HOST’]); In your server SSL setup then used below code define(‘WP_SITEURL’, ‘https://’ . $_SERVER[‘HTTP_HOST’]); define(‘WP_HOME’, ‘https://’ . $_SERVER[‘HTTP_HOST’]);

Export Yoast Keywords from MySQL/phpMyAdmin

This query pulls the post id, title, permalink, and focus keywords. You could modify this to pull the post meta description and title as well if you wanted. Change post_type to page if you want to pull pages. SELECT wpp.post_title, wpp.ID, wpp.post_date, mt1.meta_value as focus_keyword, REPLACE( REPLACE( REPLACE( REPLACE( wpo.option_value, ‘%year%’, DATE_FORMAT(wpp.post_date,’%Y’) ), ‘%monthnum%’, DATE_FORMAT(wpp.post_date, …

Read more

Send checkbox status with Ajax / JSON and save it

.prop() method return boolean type. True or false. You should send checked value and save it into database. And in HTML get your value and set it to your checkbox. An example you have <input type=”checkbox” name=”test” class=”checkbox” value=”checked”>. You should send to php $(‘.checkbox’).val(); and then place checked attr to html. <?php $checked = …

Read more

string literals in query

I misplaced a single quote. This query worked for me and solved my problem. update wp_postmeta set meta_value= concat( ‘a:1:{s:3:”url”;s:28:”‘, meta_value, ‘”;}’ ) where meta_key = ‘_woofv_video_embed’

Copy usermeta value where ID matches in the same table

use this code, it may help you $users = get_users($args); if($users) { foreach($users as $user) { $user_id = $user->ID; $shipping_first_name = get_user_meta($user_id, ‘shipping_first_name’, true); if($shipping_first_name) { update_user_meta( $user_id, ‘first_name’, $shipping_first_name); } } } for $args – refer link https://codex.wordpress.org/Function_Reference/get_users