How to delete ALL comments from certain category in WordPress database?

The wordpress database seems fairly straight forward and is extremely well documented: http://codex.wordpress.org/Database_Description It seems to me that all the category information is stored in the table wp_term_relationships. So you should select from the comments table, join it with the posts table and then the term_relationships table in order to get the category for each … Read more

wpdb prepare sql problem

To get a % character into your SQL string without confusing sprintf() add it to the replacement string: $alabala_sql = $wpdb->prepare( ” SELECT * FROM $wpdb->posts p INNER JOIN $wpdb->term_relationships tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy tt ON tr.term_taxonomy_id=tt.term_taxonomy_id INNER JOIN $wpdb->terms t ON t.term_id=tt.term_id and t.slug= %s WHERE p.post_title LIKE %s AND … Read more

Help me SELECT thumbnail from SQL and use

You do not need to be messing with the database connection. WordPress provide a database object called $wpdb. It is not really clear what you are doing. Your title reads “help me select thumb”, but your code is actually pulling a lot of different post statuses, not thumbnails. In fact, your code does not have … Read more

DB_HOST – is LOCALHOST speedy than domain name? [closed]

Usually you only have to use mysql.domain.com if connecting to a remote database. If that is what you are doing, then yes. It will be slower than a locally hosted database. Even if the domain resolves to the local server localhost should resolve quicker as it uses the loopback interface which bypasses network hardware.

What does the $posts_join filter join to?

posts_join is only a part of the full SQL query, the table you’re joining to is referenced earlier in the query. You can see the full query with the posts_request filter. See the documentation for the rest of the query filters.

How can i restore only Blogs from a SQL backup file?

“Blogs” or posts as they are called in WordPress are stored in the wp_posts table of your database. And custom fields related to your posts are stored in wp_postmeta table. So you should just be able to restore those two tables to get all your “Blogs”. This assumes your database is prefixed with wp_ of … Read more

How to dump a Microsoft SQL Server database to a SQL script?

In SQL Server Management Studio right-click your database and select Tasks / Generate Scripts. Follow the wizard and you’ll get a script that recreates the data structure in the correct order according to foreign keys. On the wizard step titled “Set Scripting Options” choose “Advanced” and modify the “Types of data to script” option to … Read more

Connect to Ms SQL Server

You have probably figured it out by now, but just in case. I was also asked to pull data from an MS SQL server and present the data on a WordPress site. In my plugin, I stored the connection values (encrypted) as options. Here are the basics. Connection Function: public function rimsdb() { global $rimsdb; … Read more

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