dbDelta not adding additional columns in plugin database update

After trial and error, here is the code that works: function installer(){ include(‘installer.php’); } register_activation_hook( __file__, ‘installer’ ); //executes installer php when installing plugin to create new database //database update checkdate function myplugin_update_db_check() { global $xenon_result_db_version; if ( get_option( ‘xenon_result_db_version’ ) != $xenon_result_db_version ) { installer(); } } add_action( ‘plugins_loaded’, ‘myplugin_update_db_check’ ); The installer.php looks … Read more

WordPress create database not working

dbDelta() is very picky, below I’ve checked the requirements for dbDelta() in your code. As you can see below your code fails two of the requirements which most likely prevents dbDelta() from creating the tables. You must put each field on its own line in your SQL statement. CHECK You must have two spaces between … Read more

Database Structure on Different Servers

I don’t think WordPress can manage two databases at the same time (unless you tweak it significantly, by means of HyperDB1). So, you’d probably will like the job of abstracting two databases and making them look like one to WordPress to be done by the database functionality. WordPress can work mostly with MySQL (see WordPress … Read more

Meta Query doesn’t works as espected

Mariolex, Have you tried using meta_query? I wrote something quick and untested but it may do the trick: $args = array( ‘post_type’ => ‘posts’, ‘showposts’ => ‘-1’, ‘meta_query’ => array( array( ‘key’ => ‘pickup_address’, //meta_key ‘value’ => ’43 Longview Drive, Papamoa’, //meta_value ‘compare’ => ‘LIKE’, //compare ), ), ); $query = new WP_Query( $args ); … Read more

How does WP work in conjunction with a web server?

Apache only runs the index.php of WordPress, and serves static files (images, css, js etc). WP does all the rest, including parsing the request to find out what content to show the user. Apache does not (and needs not) know that there is communication with a data base in PHP, and doesn’t interact with that … Read more