$wpdb wordpress returning empty array

admin

Administrator
Staff member
I have a problem which I have been trying to resolve since yesterday. I am trying to pass an SQL Query via
Code:
$wpdb
on wordpress but I keep getting an empty array when I try to echo the result.

I have tried
Code:
print_r
and
Code:
var_dump
and both are giving me empty values. I would appreciate if someone can help as I cannot seem to get this thing sorted.

I have also tried calling the table via the db prefix with still no success.

Below is the code I have been using

Code:
<?php
global $wpdb;
$results = $wpdb->get_results("SELECT CURRENT FROM upper_winds WHERE LVL=&level AND REGION=&region  AND VALID=&valid");
echo $results;
 ?>

P.S I have also tried
Code:
get_var
with the same problems.

Thanks