Print output of Table Creation

function jal_install() { global $jal_db_version; $sql = “CREATE TABLE IF NOT EXISTS WP_AWESOME_TABLES ( id mediumint(9) NOT NULL AUTO_INCREMENT, PRIMARY KEY id (id) );”; require_once( ABSPATH . ‘wp-admin/includes/upgrade.php’ ); dbDelta( $sql ); add_option( “jal_db_version”, $jal_db_version ); } register_activation_hook( _____FILE_____, ‘jal_install’ ); You have to hook the function. After activate the plugin table will created. http://codex.wordpress.org/Creating_Tables_with_Plugins

MySQL database migration to WordPress

From technical perspective wpdb->prepare() essentially trickles down to escaping variables with either (depending on configuration) mysql_real_escape_string() or addslashes(). It’s not inherently more or less secure than any other properly implemented escaping routine. It is closer to specifics of WP and configuration it is aware off.

Merging versions of wp_posts based on post_title

Found it with help from a Twitter follower! Might be handy for others. Get your backup table and import in to your live DB with a new name, e.g. wp_posts_updated. Then run this query: UPDATE wp_X_posts LEFT JOIN wp_posts_updated ON wp_posts_updated.post_name = wp_X_posts.post_name SET wp_X_posts.post_content = wp_posts_updated.post_content WHERE wp_posts_updated.post_name = wp_X_posts.post_name DON’T import your backup … Read more

Query sql for truncate post_content in wp_posts table

Backup your db Remeber to backup your db Import the backup in another database, change wp-config.php to use this new database and see if everithing is ok. (Importing is successfull? Site appear without any change?) WordPress uses a prefix for table names. The default is ‘wp_’ but clever guys change it with something else. (The … Read more