[wp-hackers] $wpdb->get_row Errors

Alex Andrews awgandrews at gmail.com
Fri Feb 12 20:19:11 UTC 2010

Dear list,

How can I have error reporting on this function? I know that I can do this:

$query = "INSERT IGNORE INTO wp_blocked_ips (ip) VALUES ('$ip')";
if ($wpdb->query($query) === FALSE) {
return FALSE;
} else {
return $wpdb->get_results($query);

But can I do anything similar with $wpdb->get_row() using equivalence
like this so I can produce a 404 when there is a problem, replacing
false above with the return of a wp_error.

Thanks very much.


More information about the wp-hackers mailing list