<?php
// Connect MSSQL
$link = mssql_connect('MANGO\SQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php', $link);
// Send a query to MSSQL
$sql = 'SELECT [name], [age] FROM [php].[dbo].[persons]';
$query = mssql_query($sql, $link);
// Iterate through returned records
do
{
while($row = mssql_fetch_row($query))
{
// Handle record ...
}
}
while(mssql_next_result($query));
// Clean up
mssql_free_result($query);
mssql_close($link);
?>