Q:

Function argument for mysqli field

Need to pass through an argument for column header in to function. 
Would like to have ["name"] be an argument in the function so I can pull different fields from sql, Can you please help. Thank you.
Here is the function: 
 function read_pages_array_2 () {
        global $connection;

        $query  = "SELECT * ";
        $query .= "FROM pages ";
        $query .= "ORDER BY id ASC";
        $result = mysqli_query ($connection, $query);
        confirm_query ($result);
        while($result_use = mysqli_fetch_assoc($result)) {
                echo $result_use["name"] . "<br/>";

        }
    }

A:

function read_pages_array_2($columnName) {
   global $connection;

   $query  = "SELECT p.".$columnName." FROM pages p ORDER BY id ASC";
   $result = $connection->query($query); // Object Oriented use of connection
   confirm_query($result);
   while ($result_use = $result->fetch_assoc()) {
      echo $result_use[$columnName] . "<br/>";
   }

Yes?

