Automate WordPress Database Upgrade

So are you going to automate your backup as well to be triggered before the DB upgrade starts? While the question has merit especially in a multisite context (in which the scenario is a little different) I am not sure that it is smart thing to do. That message could have said “this is your … Read more

Where can I find the database changes between WordPress versions?

In wp-admin/includes/upgrade.php are version specific functions for database upgrades. They include changes for the schema. Examples for 3.4.0 and 3.5.0: /** * Execute changes made in WordPress 3.4. * * @since 3.4.0 */ function upgrade_340() { global $wp_current_db_version, $wpdb; if ( $wp_current_db_version < 19798 ) { $wpdb->hide_errors(); $wpdb->query( “ALTER TABLE $wpdb->options DROP COLUMN blog_id” ); … Read more

Restoring WordPress posts from database only

Re-install a new copy of wordpress and then put in the credentials to your database in the new install. If you install wordpress and try to load the domain with no database attached, it will start the site creation wizard. Just enter the correct database credentials (username, database name, password, and location) and it will … Read more

Custom form that store input in database

I got the problem solution myself. See the code below this will do that. Put the code inside your newly created custom template. <?php if (!empty($_POST)) { global $wpdb; $table = wp_achord; $data = array( ‘name’ => $_POST[‘yourname’], ‘chord’ => $_POST[‘chord’] ); $format = array( ‘%s’, ‘%s’ ); $success=$wpdb->insert( $table, $data, $format ); if($success){ echo … Read more