I am migrated from MySQL to MS SQL Server, and trying to fetch all data from the routines table. I am connected but unsure how to fetch data with sqlsrv. This is how far I have
After you've successfully executed the query with sqlsrv_query
you can fetch the results, e.g., by using sqlsrv_fetch_array
:
$result = sqlsrv_query($db->db_conn, "SELECT * FROM routines");
if($result === false) {
die( print_r( sqlsrv_errors(), true) );
}
while( $row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC) ) {
echo $row['column1'].", ".$row['column2']."
";
}