WordPress.org

Support

Support » How-To and Troubleshooting » Different return values from $wpdb->get_var if using debugger

Different return values from $wpdb->get_var if using debugger

  • Good day,

    When running a query like this:
    $UserID = $wpdb->get_var(“SELECT ID FROM $wpdb->users WHERE user_email LIKE ’email@email.com’);
    on WP 3.01 on the main site on a MS install, with no caching plugin installed. on PHP 5.3.2-1ubuntu4.2
    if I step into the get_var function I will get the correct null result.
    if I let it run by itself it will return the string 0.
    Now its not just the presence of the debugger because if I step over the entire function the return will be string 0. I need to really walk into the entire function to get null.

    I really have no idea what to make of this. I’ve added checks for the string 0. I’m putting this here really in the hope that if others find it and have similar problems or have had similar problems they can enlighten me.
    The only “non-standard” extension we have installed may be x-cache, but I suspect its disabled when the debugger (dbg) is running.

    if anyone has any hints please let me know.

    Thank you,

  • The topic ‘Different return values from $wpdb->get_var if using debugger’ is closed to new replies.
Skip to toolbar