RE: [PHP] MSSQL_CONNECT problem
| From: | David Stoltz | Date: | Wed, 10 Dec 2008 12:51:33 +0000 |
| Subject: | RE: [PHP] MSSQL_CONNECT problem | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284411@lists.php.net to get a copy of this message | ||
-----Original Message-----
From: parasane@gmail.com [mailto:parasane@gmail.com] On Behalf Of Daniel
Brown
Sent: Tuesday, December 09, 2008 3:49 PM
To: David Stoltz
Cc: Bastien Koert; Dan Shirah; php-general@lists.php.net
Subject: Re: [PHP] MSSQL_CONNECT problem
On Tue, Dec 9, 2008 at 3:41 PM, David Stoltz <Dstoltz@shh.org> wrote:
>
> Do you have any other thoughts?
When posting to the list, please don't top-post.
Dave, are you seeing that error from both the CLI and the web?
Have you properly configured your DSN? What's the output from the
following?
<?php
mssql_connect('INTRA_SQL,1433', 'uname', 'password') or
die('MSSQL
Error on Line '.__LINE__.': '.mssql_error());
mssql_select_db('database') or die('MSSQL Error on Line
'.__LINE__.': '.mssql_error());
?>
--
</Daniel P. Brown>
http://www.parasane.net/
daniel.brown@parasane.net || danbrown@php.net
50% Off Hosting! http://www.pilotpig.net/specials.php
Sorry for "top posting", that's how my email client sets up the reply...
Anyway, I don't know what CLI is....? I see the error on the web. As for
a DSN, I didn't think I need one connecting this way. That is why the
uname, password, database is supplied, no? This should be a "dsn-less"
connection....
Either way - I tried adding a DNS on the web server, that points to the
SQL database, and that connection works...but the code I'm using from
the web page still does not....
If I use the code you gave me, this is what I get:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
server: INTRA_SQL,1433 in D:\Inetpub\wwwroot\cratos\test.php on line 2
Fatal error: Call to undefined function mssql_error() in
D:\Inetpub\wwwroot\cratos\test.php on line 2
Please advise....