get_col returning empty result on remote server
-
I am using get_col to get a listing of years in which posts were created for a given post category. The query works great on my local server AND the raw query works in both my local MySQL db and the remotely hosted MySQL db.
However the code, when run on the remote web-server version of WordPress returns an empty result when run within a page.
Again, the following code works on my home server, but returns an empty result on my live server:
$years=$wpdb->get_col( "SELECT DISTINCT YEAR(post_date) FROM $wpdb->posts key1, $wpdb->term_relationships term WHERE key1.ID = term.object_id AND term.term_taxonomy_id = 55 ORDER BY post_date" );
Does anyone know wny a query would work in phpMyAdmin, but not work when run within WordPress itself?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘get_col returning empty result on remote server’ is closed to new replies.