Support » Fixing WordPress » get_row and Select all

  • jaspol@hotmail.com

    (@jaspolhotmailcom)


    I have a SQL statement that works like this:

    $qnm = $wpdb->get_row($wpdb->prepare(“SELECT col1,col2 FROM ml_table WHERE col3 = $somevariable”));
    I return results like $qnm->col1 and get a value

    But it does NOT work like this:

    $qnm = $wpdb->get_row($wpdb->prepare(“SELECT * FROM ml_table WHERE col3 = $somevariable”));
    I return results like $qnm->col1 and do NOT get a value

    Why does the Select specific columns work, but Select * does not? I’ve tried reading through documentation but can’t find anything. Thanks in advance!

  • The topic ‘get_row and Select all’ is closed to new replies.