Selecting NULL value from the database

There is no specific issue with retrieving null values from the database. They will come back as the PHP NULL value. WordPress uses either the function mysqli_fetch_object or mysql_fetch_object to retrieve results from the database. https://php.net/manual/en/function.mysql-fetch-object.php https://php.net/manual/en/mysqli-result.fetch-object.php According to those respective pages: Note: This function sets NULL fields to the PHP NULL value. Are you … Read more

Sending WordPress database information to cross domain the safe way?

If you have to do this with php then you are going to want to use the WP_Http class. Specifically, you’ll probably want to use wp_remote_post(). Something like this should get you started. function pushData($data){ //data is an associative array of the things you want to send $url = “https://yourhost.com/your_catch_script.php”; return wp_remote_post($url, array( ‘method’ => … Read more

live site do not update after importing sql database

I had something similar, entries of some post types didnt show. If your posts have the same IDs between dev/live environment, get the edit URL and replace the ID to see if it loads. Like : http://yoursite.com/wp-admin/post.php?post=23&action=edit Replace the ID (here ’23’) by the ID of the post/page/anythingelse you cannot see in live. If this … Read more

WordPress and SQL – Update and Insert from another table if column value doesn’t exist

Use PHP and the WordPress API. Place the following in copy-options.php and FTP it to wp-content/plugins, then activate it from the main site: <?php /** * Plugin Name: Copy Options * Plugin URI: http://wordpress.stackexchange.com/q/186092/1685 * Description: Copy options from site 2 to site 1. * Version: 0.1 * Author: TheDeadMedic * Author URI: http://wordpress.stackexchange.com/users/1685/thedeadmedic */ … Read more