Relaunch 4.2 utf8mb4 database upgrade

I think the answer to your question right now is “No”. There is no easy way to trigger maybe_convert_table_to_utf8mb4 on sites once they were already upgraded beyond WP 4.3 on a server that didn’t meet the requirements laid out in this post: https://make.wordpress.org/core/2015/04/02/the-utf8mb4-upgrade/ Note that, based on looking at WP source code, it seems they … Read more

$wpdb won’t insert NULL into table column

Update: Since WordPress 4.4. this is now supported by the insert, update, replace and delete methods of wpdb and the ticket #15158 has been closed as fixed. Thanks to @dmsnell for commenting about that update. On the other hand, the null support in wpdb::prepare() is currently closed as wontfix in ticket #12819. Previous answer: NULL … Read more

How to replace the domain name in a WordPress database?

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. The data you’re looking at is not JSON formatted. JSON doesn’t (normally) store value types and lengths like that. What you’re looking at is … Read more

Checking if Database Table exists

If you use “IF NOT EXISTS” then the dbdelta script will not upgrade your database with delta’s appeared after the initial creation of the database. (assuming you want to re-use the same sql script) at least… that is what i think

get_results using wpdb

global $wpdb; $result = $wpdb->get_results ( ” SELECT * FROM $wpdb->posts WHERE post_type=”page” ” ); foreach ( $result as $page ) { echo $page->ID.'<br/>’; echo $page->post_title.'<br/>’; }