|
-
Apr 29th, 2009, 04:51 AM
#1
Thread Starter
Fanatic Member
connecting to mssql
hi,
i have a mssql server 2005 database on a windows server 2003 machine and would like to connect to it from my php webserver which is a centos based server.
i tried the mssql_connect() from my php code and it gave me the error:
Code:
Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: {sql server ipaddress}
i installed wamp on my winxp workstation and tried it there. got the same error.
i can connect to the sql server from my winxp using the sql dev studio.
i also tried to google and found several workarounds:
i'm sure php.ini has extension=php_mssql.dll and mssql.secure_connection = Off
and i also have ntwdblib.dll in all directories, system32, apache2/bin, php
no use.
still got the same error
help!
cheers,
lerroux
WARNING: Excessive coding is dangerous to your health... if symptoms persist insult your doctor...
-
Apr 29th, 2009, 05:10 AM
#2
Re: connecting to mssql
post your code? you aren't seriously trying to connect to "{sql server ipaddress}," are you? (hopefully, you just removed your IP address from being paranoid!)
make a phpinfo file (file containing a call to the phpinfo() function) and make sure that the MSSQL extension is actually registering. you should be able to do a find on the page and search for "mssql." if nothing is found, then the extension isn't being loaded.
-
Apr 29th, 2009, 05:30 AM
#3
Thread Starter
Fanatic Member
Re: connecting to mssql
Code:
<?php
$myServer = "ipaddress";
$myUser = "myuname";
$myPass = "mypassword";
$myDB = "ARIAL1";
//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
or die("Unable able to connect to $myServer");
//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
or die("Couldn't open database $myDB");
?>
got that code from other forums. seems to be working for them.
WARNING: Excessive coding is dangerous to your health... if symptoms persist insult your doctor...
-
May 1st, 2009, 12:13 PM
#4
Frenzied Member
Re: connecting to mssql
They probably put in their IP address where it says "ipaddress", along with their username and password for the DB.
-
May 6th, 2009, 07:12 AM
#5
Thread Starter
Fanatic Member
Re: connecting to mssql
i know that. i just replaced it with ipaddress so that i wont be posting my real ip address here...
anyone know how i get around with this?
WARNING: Excessive coding is dangerous to your health... if symptoms persist insult your doctor...
-
May 8th, 2009, 09:46 AM
#6
New Member
Re: connecting to mssql
I am also running into the same problem right now. My development box (WAMP) won't talk to the MSSQL box, but my SQL Client (Squirrel) does just find. Also, the ODBC connection test in Vista works, as well.
I've tried the new DLL, checking to make sure the information is listed in PHPInfo, and even a couple other things, but I'm still stumped. Any further advice would be amazing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|