This may not be the best way of doing things, but it works for me OK and a couple of fairly heavy duty apps I've written running under PHP 4.4 and IIS 6 on Windows 2003 Server 😃
To connect to the database, (I keep the values in an inc file outside of inetpub)
$link = @mssql_connect($dbHost, $dbUser, $dbPass);
$dbselect = @mssql_select_db($dbName);
To perform a query (copied from a rather long script .....)
$query6 = "Select max(benchid) as benchid from benchmarks where requestorid='".$userid."'";
$result6 = mssql_query($query6);
$row6 = mssql_fetch_array($result6);
$benchid = $row6['benchid'];
For looping through the array you also have
while($row = mssql_fetch_array($result)) {
$linenum = $row['linenum'];
echo $linenum;
echo "<br>";
}
Nice thing about coding it like this is that search and replace mssql with mysql and you've got code that works with mysql.
You do need to check phpinfo() that you have enabled support for mssql, you do this via the appropriate extensions dll.
Hope this helps,
Blu