Hi Y'all...
I am having troubles connecting to my PHP script to SQL Server 2000 database running on a Windows 2003 box.
Here is an example of a php code I use to pull from an SQL Server 2000 database running on an Windows 2003 Server box:
<?php
$Connect = mssql_connect("database", "username", "password");
mssql_select_db("otss");
$system = mssql_query("select name from tb_system order by name", $Connect);
while($name=mssql_fetch_row($system)) {
$n = $name[0];
echo "NAME = $n <BR>";
}
mssql_close($Connect);
?>
This is what I see on the web site when I load it:
Warning: mssql_connect(): Unable to connect to server: sm1c0h in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 2
Warning: mssql_select_db(): Unable to connect to server: (null) in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 3
Warning: mssql_select_db(): A link to the server could not be established in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 3
Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 5
Warning: mssql_fetch_row(): supplied argument is not a valid MS SQL-result resource in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 6
Warning: mssql_close(): supplied argument is not a valid MS SQL-Link resource in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 10
But if I change the link to a server running Windows 2000 on it this code works fine.
Does anyone know where I can find resources how to resolve this issue or can maybe tell me what I need to do to connect php to a windows 2003 box?
Thanks
Angelo
I am having troubles connecting to my PHP script to SQL Server 2000 database running on a Windows 2003 box.
Here is an example of a php code I use to pull from an SQL Server 2000 database running on an Windows 2003 Server box:
<?php
$Connect = mssql_connect("database", "username", "password");
mssql_select_db("otss");
$system = mssql_query("select name from tb_system order by name", $Connect);
while($name=mssql_fetch_row($system)) {
$n = $name[0];
echo "NAME = $n <BR>";
}
mssql_close($Connect);
?>
This is what I see on the web site when I load it:
Warning: mssql_connect(): Unable to connect to server: sm1c0h in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 2
Warning: mssql_select_db(): Unable to connect to server: (null) in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 3
Warning: mssql_select_db(): A link to the server could not be established in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 3
Warning: mssql_query(): supplied argument is not a valid MS SQL-Link resource in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 5
Warning: mssql_fetch_row(): supplied argument is not a valid MS SQL-result resource in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 6
Warning: mssql_close(): supplied argument is not a valid MS SQL-Link resource in E:\ApacheWeb\htdocs\angelo\connect_pull.php on line 10
But if I change the link to a server running Windows 2000 on it this code works fine.
Does anyone know where I can find resources how to resolve this issue or can maybe tell me what I need to do to connect php to a windows 2003 box?
Thanks
Angelo