PHP populate dropdown menu with items from sql server table

Could someone post a sample on how to populate dropdown menu with column items from sql server table?
My connection to SqlServer database is like this:

$servername = ""; 
$connectionInfo = array(
    "Database"=>"", 
    "UID"=>"", 
    "PWD"=>""
);
$conn = sqlsrv_connect($servername, $connectionInfo);
if( $conn === false ) {
    echo "Error (sqlsrv_connect): ".print_r(sqlsrv_errors(), true);
    exit;
}

So what’s the problem with just making a query and putting the results into option-elements?

How would i do that?

PHP provides a lot of documented functions with example

https://www.php.net/manual/en/ref.sqlsrv.php

Sponsor our Newsletter | Privacy Policy | Terms of Service