Fixed wpdb query