wp_option table error while importing

I was able to solve my own problem, while its was a very struggling effort.If your database is corrupt, but you want to restore your site. Just open your database in a any program like TextEdit, Notepad++ and make sure you copy the basic databases mention here in a new database, that will at least … Read more

Using mysql to replace img src?

This feels like it is too link-heavy for an answer, but oh well. You can either use the Velvet Blues Update URLs plugin or the Serialized Search and Replace script. Either will allow you to search for a string in the database and change it to something else. The former lets you do it from … Read more

List users with the most posts in the last 30 days

Here is what you need. <?php $date = new DateTime(‘NOW’); $date->sub(new DateInterval(‘P30D’)); //30 Days Interval echo $back30days= $date->format(‘Y-m-d H:i:s’) . “\n”; global $wpdp; $top_users = $wpdb->get_results(“select count(users.user_nicename) as posts, users.user_nicename as user_name from $wpdb->users as users join $wpdb->posts as posts where users.ID = posts.post_author AND posts.post_status=”publish” AND posts.post_date_gmt > ‘$back30days’ GROUP BY users.user_nicename ORDER BY … Read more

How Do I Delete WordPress Posts Older Than 400 Days, From A WordPress Category

Addition note and warning: always always always take backups before doing anything in your database. It’s very easy to do something you didn’t mean to and lose tons of data, especially when dealing with DELETE statements. Also, if your database is using InnoDB for the database engine, you can use transactions via BEGIN, ROLLBACK, and … Read more

phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’

From what I can see, you are inserting data in table wp_commentmeta. However the column meta_id has a Primary Key restriction. You can see the table definition at http://codex.wordpress.org/Database_Description#Table:_wp_commentmeta As meta_id has a Primary Key restriction, this column may only hold unique values. The insert statements you have posted show only unique values for meta_id, … Read more

Change WordPress Multisite Domain

When I move domains and have to change the domain in the database, I use interconnectit’s Search and Replace tool. Here is a very brief overview of the process. Export the database and upload it to the new server. Upload interconnectit’s Search and Replace tool to the new server. Configure what I want to be … Read more

Files on Localhost, Database on Server

Yes, the 404 is because the local and remote server URLs are different. As a solution: You should set the local domain to be the same as the remote server In wp-config.php connect to the remote DB When you will need to access the remote server you’ll need to update the file hosts and comment … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)