Am I missing something here, this code worked fine on my other server with mysql:
All I want to do is test to make sure php will work with SQL server, and I am getting this BS:
Parse error: syntax error, unexpected T_IF in C:\wamp\www\q.php on line 28
:mad:
<html>
<head>
<basefont face="Arial">
</head>
<body>
<?php
// set database server access variables:
$host = "company.domain.com";
$user = "username";
$pass = "password";
$db = "PCInventory";
// open connection
$connection = mssql_connect($host, $user, $pass) or die ("Unable to connect!");
// select database
mssql_select_db($db) or die ("Unable to select database!");
// create query
$query = "SELECT * FROM dbo_Users";
// execute query
$result = mssql_query($query)
// see if any rows were returned
if (mssql_num_rows($result) > 0) {
// yes
// print them one after another
echo "<table cellpadding=10 border=1>";
while($row = mssql_fetch_row($result)) {
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>" . $row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "</tr>";
}
echo "</table>";
}
else {
// no
// print status message
echo "No rows found!";
}
// free result set memory
mssql_free_result($result);
// close connection
mssql_close($connection);
?>
</body>
</html>