You may want to try using the Sybase drivers.

MS basically bought Sybase and re-named it MS SQL and then broke a lot
of stuff :-)

One of the things they haven't broken (yet) is the basic Sybase driver
functionality to send queries.

For sure, ' versus " won't make any difference.

You may want to take out he :xxxx port info -- unless you've worked
hard to set up the server on some weird port or something, the default
should just work.

Also see if there are any error messages available:
  in Apache error log
  in MS SQL error logs (good luck!)
  in mssql_error() or whatever it is
  in $php_errormsg or whatever it is (turn it on in php.ini)

You might also want to try running ethereal or netstat or whatever it
is that will tell you what traffic is happening across your
ethernet...

On Tue, June 12, 2007 9:00 am, Tommy Peterson wrote:
> All:
>
> I can't seem to connect to a SQL Server database with PHP. I have read
> the
> php.net documentation and so many other forums on the Internet that my
> eyes were literally blood shot. Today I thought I would try this
> route.
>
> I have PHP and Apache installed on my local machine. They work fine as
> I
> created another application with them (and MySQL) that worked as
> expected/designed. I want to connect to MS SQL Server 2000 that rests
> on
> another machine here at work. I can reach the tables and do whatever I
> want with them from my machine through SQL Query Analyzer. (The other
> machine runs a Windows Server. So I am trying to connect from one
> Windows
> box to another Windows box.) So I know that I can connect to the
> tables
> (and the machine that they rest on) from my machine. It is just that I
> get
> the following error when I load my PHP page: "Warning: mssql_connect()
> [[
> http://localhost/development_files/ordertrackno/where_is_it.php/function.mssql-connect
> ]function.mssql-connect]: Unable to connect to server: . . . "
>
> In my PHP page I have the following:
> $sql = mssql_connect ("xx.xx.xx.xx:xxxx", "xx", "xxxxxx");
> $conn=mssql_select_db("xx", $sql);
> etc
>
> I have tried replacing the semicolon with a comma as some have said. I
> get
> the same error. I have tried replacing the quotation marks with an
> apostrophe and I get the same error.
>
> I have the Client tools installed on my machine. (I should mention
> that
> they are not installed on the Apache on my machine as I could not get
> them
> to install from the SQL Server disk to that location--only to the
> hardrive.). Again, they connect to the database. I can query the
> database
> from my machine. I have the latest ntwdblib.dllinstalled in the php,
> php\extension, apache\bin, and system 32 directories.
>
> What else . . .
>
> I have tried setting the msssql.secure_connection to both off and on
> and I
> still get the same error.
>
> I have ensured that TCP/IP and Named Pipes are enabled in the SQL
> Configuration tool.
>
> I have asked the network guy to help out but no luck there.
>
> Again, I am at a loss and need to get this up and running. Any
> suggestions
> would be appreciated.
> Thanks.
>
> Tommy
>
>
>
>
>
>
>
>
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to