对如何填充select元素感到困惑

I have this function that fetches the authors from db

function loadAuthors(){
    $db=new DbConnect;
    $con=$db->connect();

    $stmt=$con->prepare("select * from authors");
    $stmt->execute();
    $authors=$stmt->fetchAll(PDO::FETCH_ASSOC);
    return $authors;
}

I am calling this function here

function fetch(){

    $result='';

    $authors=loadAuthors();
    while (list($k,$v)=each($authors)) {
        $result.='<option value="'.$k.'">' .$v.'</option>';
    }
    return $result;



}

I am trying to populate the options of a select element but It gives me this output

Array
Array

You can debug your output with var_dump(). Your loadAuthors returns an array containing asociatetive arrays. Also you then have define what columns you want to display. An author is an object.

Smth like this should work:

/* ... */
foreach ($authors as $author) {
  $result.='<option value="'.$author["column_name"].'">' .$author["column_name"].'</option>';
}
/* ... */