WordPress tables and aliases?

‘re’ is the alias you give to EVENT_ESPRESSO_RECURRENCE_TABLE. The error you’re seeing is probably because the EVENT_ESPRESSO_RECURRENCE_TABLE constant isn’t defined. Do a var_dump( $wpdb->last_query ) just below that code to see the final SQL statement.

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

AJAX wp-mysql running too slow

When you call the database directly rather then using the $wpdb object its faster for a simple reason which is you only call the database, and the when you use $wpdb it loads extra functions and basically most of WordPress before you can use the $wpdb object. What you should try is to use the … 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

Removing posts by sql

You’re probably better off doing this with wordpress functions and adding a button which would delete all posts (or even having a shortcode that, when loaded, would do it). The reason I recommend doing this instead of SQL directly is that wp_delete_post() will take all the associated meta with it, which saves you having to … Read more

Importer fails to import every post

Open the WXR in a text editor and see if it contains posts from later years. If not, you will need to revisit your export settings from WP.com to make sure you’re pulling all posts. If it does contain posts from these years, there might be a non UTF8 character breaking the import. You should … Read more

How to migrate a database from a server to another

The database user name/password is not stored in the database; it is only used to access the database. Change the username (and password, too) to the new values in wp-config.php. And the problem might be access to the database via phpmyadmin; check your username/password in Cpanel or some other hosting control panel.