WordPress $wpdb get posts from category and sort by custom meta

First, you shouldn’t use NOW() in select queries since NOW() returns the current date and time to the split second. In other words: This query will never land in the cache. And you can use the WP_Query with filter of posts_where eg: function filter_event_where( $where=”” ) { $date = date(‘Y-m-d’); $where .= ” AND posts.post_date … Read more

Query posts by custom taxonomy and sort by post_modified

The WP_Query function can be used on custom taxonomies and post types and is probably easier than querying the database directly. The following should do what your looking for: <?php $query_hot = new WP_Query( array( ‘post_type’ => ‘vacancy’, ‘field’ => ’18’, // You can use the ID or slug here ‘orberyby’ => ‘modified’, ‘posts_per_page’ => … Read more

Changing MySQL password via WHM – does this affect WordPress?

If that changes the MySQL password that WordPress is using, and it sounds like it does, then yes you will have a problem, but not a big one. You’d need to edit wp-config.php and change define(‘DB_PASSWORD’,’oldpass’); to define(‘DB_PASSWORD’,’newpass’); Beyond that, the question is a CPanel question and would be off topic here. http://codex.wordpress.org/Editing_wp-config.php#Set_Database_Password

How to stop $wpdb from prepending database name

The behavior I described in my post only happens when you are using $wpdb->update to execute an UPDATE statement. If you want to update a different database using the same connection, use $wpdb->query to send a raw query, WP won’t modify it then.

Active DB queries in WordPress?

wpdb doesn’t include such kind of API, mostly since it descended from ezSQL which didn’t either (as far as I remember). While there are some helpers for insert/update stuff, most of query abstraction happens in WP_Query since that’s where bulk of complicated querying is typically going on.

Using WPDB->Insert()

Short answer, no. WPDB is a class that’s been around for a while (back when WP used to support PHP 4), and lacks a lot of features PHP5 drivers offer, including parameter binding. As you mentioned, wpdb::insert is the closest you can get to your original code: $wpdb->insert( ‘importtest’, array( ‘id’ => $ID, ‘area’ => … Read more

Is there a page length limit?

The post content field is MySQL type longtext, which has a limit of 4 gigabytes. What you may be encountering is an issue with the TinyMCE editor. Content is processed and validated in the browser with JavaScript. If that’s the case, I doubt you will improve your situation by using Drupal, since you will be … Read more

Can’t run database query

Here issue with the column name. You are using column key in the query which is the default keyword/index in mysql. For resolving this kind of issue just use the “Grave accent(`)’ symbol in the query for the column name, No need to change the column name. So in your case the right query is … Read more

WordPress create database not working

dbDelta() is very picky, below I’ve checked the requirements for dbDelta() in your code. As you can see below your code fails two of the requirements which most likely prevents dbDelta() from creating the tables. You must put each field on its own line in your SQL statement. CHECK You must have two spaces between … Read more