Hi, I've been working on this one for little while, but still haven't quite got it to work. I have get_results function working, but can't get_col to work.
$user_search = esc_attr($_POST['city']); global $wpdb; global $user_search; $address_table = $wpdb->prefix . "address_table"; $query = $wpdb->get_col('SELECT city FROM ' . $address_table . 'WHERE city = ' . $user_search ); print_r($query);
I have this code set up to pull data from a custom table called 'address_table'. The columns are: city, address_id, and, hit_date
I am getting this result: array()
Am I using get_col correctly, and do I have the query set up correctly? Thanks ~