I have a Stored Procedured which creates a temporary table (#test), fills it with data from another table, runs 3 selects on this temporal table and drops it.
The or
// this example for storing the data in drop down menu - php
// need to connect data base first
$connectionInfo = array( "Database"=>$database, "UID"=>DATABASE_USER, "PWD"=>DATABASE_PASSWORD);
$conn = sqlsrv_connect( $serverName, $connectionInfo);
/// $SQLquery = NOTE write sql query here
$stmt = sqlsrv_query( $conn, $SQLquery );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
} else {
Display("SQLquery executed");
}
$result = array();
$fetchLimit = 0; // control the infinite loop
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
//echo $row['COLUMN_NAME']. "
";
// Loop through each result set and add to result array
$result[] = $row['COLUMN_NAME'];
// results store here = you need to change 'COLUMN_NAME' based on yoru sql query received data name
$fetchLimit++;
if($fetchLimit>60000)
break;
}
echo dropdown( "test", $result, 1000 );
add this function for storing in drop down
function dropdown( $name, array $options, $selected=null )
{
/*** begin the select ***/
$dropdown = ''."\n";
/*** and return the completed dropdown ***/
return $dropdown;
}