How do I detect errors when using $wpdb->get_results()?
For example:
$result = $wpdb->get_results("SELECT * FROM this is not a valid query");
The preceding code doesn't generate any exceptions or errors; it simply sets $result to an empty array. How do we reliably detect errors generated by get_results()?