i'm attempting to make an easy selection inside a wordpress table (produced with a wordpress plugin). the table is known as reduceri , and it has the next posts: id, post, category.

so, i'm attempting to take all of the category values, once the publish is equivalent to the present publish id.

generate an income am doing the totally:

$the_query = "
SELECT $wpdb->reduceri.category 
FROM $wpdb->reduceri
WHERE $wpdb->reduceri.post = ".$post_id."    

$my_reduceri = $wpdb->get_results($the_query);

however when i var_dump the $my_reduceri all i recieve is definitely an empty array: array(0) { } despite the fact that there should really be some results... any idea where i'm wrong (within the query)?


Have you declared global $wpdb before by using this query?