Get error messages when $wpdb->insert() returns false?

$wpdb->insert() method returns false if the row could not be inserted. Otherwise, it returns the number of affected rows (which will always be 1). You can turn error echoing on and off with the show_errors and hide_errors, respectively. <?php $wpdb->show_errors(); ?> <?php $wpdb->hide_errors(); ?> You can also print the error (if any) generated by the … Read more

The MySQL alternatives: Do Percona Server and MariaDB work well with WordPress, and do they make WordPress go better?

I have personally worked with Percona Server and MySQL, not with MariaDB as of yet. Percona provides support for MariaDB, Drizzle, Amazon RDS, and other MySQL products. I learned at Percona Live NYC that Percona gets the latest version of MySQL and injects 30,000 lines of C/C++ that is unique to its Performance Enhancements. MySQL … Read more

Please explain how WordPress works with MySQL character set and collation at a low level

There are two defines in wp-config.php of WordPress website: define(‘DB_CHARSET’, ‘utf8’); define(‘DB_COLLATE’, ”); There are several things which are most commonly misunderstood. Names of constants in those defines, might suggest that they are related to the database itself. They are not. They are related to tables within the database. Database creation is totally independent from … Read more

WordPress mysqli and PDO

WordPress uses mysql_* functions. http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/wp-db.php It has used those ever since I can remember, which probably answers your last question. It is what I would consider legacy code. I suspect it will be updated sometime soon (those functions were only deprecated as of PHP 5.5, I believe). I don’t know which route development will go. … Read more