|
Posted by Jerry Stuckle on 06/05/05 23:27
mj@lightfootarts.com wrote:
> Hello, thanks for the help.
>
> I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm
> firewall)
>
> Apache 2.0.52
> MySQL 4.1.7
> PHP 5.1.0-dev
>
> I have developed a PHP/MySQL web app that tracks jobs for me, and we
> use it on our peer-to-peer network. This program works GREAT :)
>
> I also have a company website hosted remotely, where clients can place
> a job request.
>
> Win2k
> IIS
> MS SQL Sever 2000
>
> On this web site we have a MSSQL database that records all the jobs
> that where placed through the web site.
>
> What I what to do know is connect to the remote MSSQL server and run
> some SELECT statements with PHP.
>
> NOW ... I can connect to the remote MS SQL sever with the client tools,
> Enterprise Manager, and I can setup and connect with ODBC.
>
> What I can't do is get php to connect to it.
>
> - I have ntwdblib.dll in my c:\windows\system32 & c:\apache2\bin &
> c:\php folders (year 2000 version)
>
> - In SQL Sever Client Network Utility I only have TCP/IP as an "Enabled
> protocols"
>
> - I have extension=php_mssql.dll in my php.ini
>
> - when I run:
>
> function_exists('mssql_connect');
>
> it returns true so I know that php_mssql.dll loaded OK
>
> This is the code I try and connect with:
>
> <?php
>
> $host="mssql.dumbname.net";
> $user="user";
> $password="password";
>
> mssql_connect($host,$user,$password) or die ("could not connect to
> server"); // <-------- It always dies here. :(
>
> mssql_select_db("trtrades") or die ("could not connect to DB");
>
> ...
>
>
> ?>
>
> I know that the $host, $user, and $password are right because I can
> connect to the remote DB with the client tools.
>
>
> I also tried connect using php's ODBC functions:( I have already
> created the DNS that is need)
>
> odbc_connect($host,$user,$password) or die("can not connect to sever");
> // <--------- This always dies as well
>
> and still know luck ...
>
>
> I have been working at this for a few days now, and searched all over
> the net and groups for a solution to my problem with no luck.
>
> I hope that someone might be able to help.
>
> Cheers;
>
> VanMan
>
What kind of error message do you get from your connect attempts (other
than the die messages)? Did you check the user notes in the
documentation (http://www.php.net/manual/en/function.mssql-connect.php)?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|