<?php
// Connect to MSSQL and select the database
$link = mssql_connect('KALLESPC\SQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Select all our records from a table
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
echo 'Total records in database: ' . mssql_num_rows($query);
// Clean up
mssql_free_result($query);
?>