• When I run get results for the following code, I get the row values for all columns with the exception of ID. Here is the key elements of the code:

    $users = $wpdb->get_results("SELECT wp_users.ID,display_name,meta_value FROM wp_users,wp_usermeta WHERE (wp_users.ID = wp_usermeta.user_id) AND ".
    	    	"ORDER BY wp_users.display_name ASC");
    
    foreach ($users AS $userRow)
    {
         <input type="hidden" name="userID[]" value="<?php echo $ID;?>">
         echo $userRow->display_name;?>
    }

    This would echo “ID” on the first line and the actual display name on the second. Any help is appreciated.

  • The topic ‘Get_Results returning a column name (ID)’ is closed to new replies.