My php is not able to connect to a SQL Server box. PHP is *NOT* running as CGI but rather ISAPI filter. Here is my example code:
<html>
<head>
<?php
$conn = mssql_connect("Server","User","Password");
if($conn){
if(!mssql_select_db("Database",$conn)){
die("Database unavailable");
}
$query = "SELECT * FROM User.Table";
$result = mssql_query($query);
if(!$result){
die("SQL error");
}
while($row = mssql_fetch_row($result)){
echo $row["column"] . "<br/>";
}
}
else die("Server unavailable");
?>
</head>
<body>
<center>
<table>
<tr><td>Data</td></tr>
<?php echo $tablerow; ?>
</table>
</center>
</body>
</html>
The resulting output is:
<html>
<head>
... and that's it. No error, nothing. It just dies w/o any of the messages declared in my code. That's why I put the PHP code in the head because when I ran prior to the <html> declaration I got only the standard html element tags. This way I know it delivers *part* of the document.
My configuration is:
PHP Version 5.2.1
Windows 2003
IIS 6
MS SQL 2000
PHP Installed to: C:\Program Files\PHP\
PHP.INI File in: C:\Program Files\PHP\php.ini
Extension in PHP.INI: extension=php_mssql.dll
mssql.ddl in C:\Program Files\PHP\ext AND C:\Windows\System32
ntwdblib.dll in C:\Windows\System32
SQL Server client tools installed on IIS box
The IIS and SQL Server boxes are separate, but other apps (both ASP and Perl) are connecting to that server and DB using the same credentials specified in mssql_connect().
I've run out of things to try. Somebody please help!!
<html>
<head>
<?php
$conn = mssql_connect("Server","User","Password");
if($conn){
if(!mssql_select_db("Database",$conn)){
die("Database unavailable");
}
$query = "SELECT * FROM User.Table";
$result = mssql_query($query);
if(!$result){
die("SQL error");
}
while($row = mssql_fetch_row($result)){
echo $row["column"] . "<br/>";
}
}
else die("Server unavailable");
?>
</head>
<body>
<center>
<table>
<tr><td>Data</td></tr>
<?php echo $tablerow; ?>
</table>
</center>
</body>
</html>
The resulting output is:
<html>
<head>
... and that's it. No error, nothing. It just dies w/o any of the messages declared in my code. That's why I put the PHP code in the head because when I ran prior to the <html> declaration I got only the standard html element tags. This way I know it delivers *part* of the document.
My configuration is:
PHP Version 5.2.1
Windows 2003
IIS 6
MS SQL 2000
PHP Installed to: C:\Program Files\PHP\
PHP.INI File in: C:\Program Files\PHP\php.ini
Extension in PHP.INI: extension=php_mssql.dll
mssql.ddl in C:\Program Files\PHP\ext AND C:\Windows\System32
ntwdblib.dll in C:\Windows\System32
SQL Server client tools installed on IIS box
The IIS and SQL Server boxes are separate, but other apps (both ASP and Perl) are connecting to that server and DB using the same credentials specified in mssql_connect().
I've run out of things to try. Somebody please help!!