MySQL select query with ajax

Your list.php file does not load any of the WordPress Core, at least there is no indication that it does based on the code you posted. Thus, WordPress classes and functions are not going to be available, hence the error. Merely having a file in the theme folder does not mean that WordPress will load … Read more

Separate DB by yearly archive of WordPress

I needed this for a client recently (he wanted to do the same but be able to create a archive by himself in the wordpress backend) and couldn’t find a good plugin for it. It’s pretty easy to custom code this actually. You just need to make your install a network install and then place … Read more

MySql Query very slow

You must use a temporary table and an alias: SELECT SQL_CALC_FOUND_ROWS * FROM meruca_posts WHERE ID NOT IN (SELECT ID FROM ( SELECT object_id as ID FROM meruca_term_relationships WHERE term_taxonomy_id IN (14) ) AS temp_object) AND post_type=”post” AND post_status IN (‘publish’,’private’) GROUP BY ID ORDER BY post_date DESC LIMIT 0, 10

$wpdb->wp_users returning empty value for

First of all why you would need custom query for this basic functionality to get users, when WordPress has inbuilt function get_users(). Anyway for custom query, table name is defined as function custom_func(){ global $wpdb; $getTest = “SELECT * FROM $wpdb->users LIMIT 1”; $arrayReturned = $wpdb->get_results($wpdb->prepare($getTest)); } It’s $wpdb->users or $wpdb->post and not $wpdb->wp_users, what … Read more