Articles of database

How to export/import theme customizer settings?

I am wondering if it is possible to export theme customizer settings(theme_mods) to be imported into another install of the same theme. I know that the settings are saved into the database so I am wondering if there is a plugin or tool to create a XML file for import like many themes have for […]

How does WordPress handle MySQL row lock errors?

If there is a WordPress plugin which updates rows in a custom table, but that update encounters a row lock, what happens? E.g. two users simultaneously fire an update on TABLE1, one setting AGE=1 and the other setting AGE=2: Will there be a row lock at all? Will MySQL handle this “gracefully” and one of […]

Database connection close

Is there any method to close connection similar to mysql_close() for $wpdb in WordPress? Is it not necessary to close connection for global $wpdb?

Resetting comment count

Recently, I had to move to another domain and had to recreate all my MySQL tables on the enw server. I noticed that for some posts, the number of comments is doubled. Example – In the above post, there’s only 4 comments, but the comment count shoes 8 comments. I am not sure it […]

Backup the Database and Restore from the Backup?

I am using WordPress 3 and would like to backup the database to my computer (a Mac). My webhost is using PHP safe mode, so that sometimes limits what plugins I can use. What is a good way to do a database backup? Is it possible to be automated? Are incremental backups recommended/easy? Obviously I […]

what is the use of /wp-includes/SimplePie?

I have this location on my server. /home/localhost/public_html/wp-includes/SimplePie. I have not installed samplepie plugin. What is it used for since it is not associated with samplepie plugin. The reason I ask is that, I have fatal error generated from different php files in that location. Each time I debug the error a new error in […]

How to get the post publish date outside the loop?

I need to pull out the post publish date in order to make the post post auto expire. The thing is I can’t get the right publish date. Here is my code: global $wpdb; $post_ids = $wpdb->get_results( “SELECT ID FROM $wpdb->posts WHERE post_status =’publish'” ); foreach($post_ids as $id){ $postdate = get_the_date(“Y-m-d”,$id ); //here is what […]

Does wpdb add considerable overhead on queries with large result sets?

I am working on backup-related plugin and from some research of existing plugins – they seem to favor using PHP’s mysql_* functions, rather than $wpdb. Is $wpdb overhead considerable enough that it is unsuitable for such task as querying whole database tables?

Default table collation on plugin activation?

I’m following this to make my plugin auto-create a table when the plugin is activated, but what happens is that while all the tables (the whole db) are utf8_general_ci, the newly created table is latin1_swedish_ci… Why isn’t it also utf8? I thought it would also be utf8 by default since I have: define(‘DB_COLLATE’, ‘utf8_general_ci’); in […]

Restoring WordPress posts from database only

I paid 1and1 my payment, but even after showing payment proof they deleted my entire account, domain and all. I only have my Database left (long ago I took a database backup using phpMyAdmin). Can I get my posts back from it?