Forums

[resolved] WPDB Query Result (3 posts)

  1. InfiniteKnight
    Member
    Posted 3 years ago #

    What result is tossed by WPDB when there is no results to a query? Is it an empty result or a NULL return? IE What do I test for in a if statement? "" or NULL?

    $userdata = $wpdb->get_row("SELECT * FROM $users_table WHERE user_email = $email", ARRAY_A);

    I need to be able to know which result is thrown if no row is found that matches the query...

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    if ($userdata) {
    echo 'found something';
    }
  3. InfiniteKnight
    Member
    Posted 3 years ago #

    Cool, wasn't sure if it was going to be that easy with the rest of things I have found out with what I am trying to do...

Topic Closed

This topic has been closed to new replies.

About this Topic