View Single Post
  #1 (permalink)  
Old 06-10-2007, 05:42 PM
Netsanet E
Posts: n/a
[SOLVED] How to connect to MS SQL server 2000 from php?

I copied ntwdblib.dll 2000.80.194.0 from MS Sql and pasted in php.
Added the following to php.ini file
sql.safe_mode = On
mssql.allow_persistent=1
mssql.max_persistent=-1
mssql.max_links=-1
mssql.min_error_severity=10
mssql.min_message_severity=10
mssql.compatability_mode=0
mssql.connect_timeout=5
mssql.timeout=60
mssql.textsize=-1
mssql.textlimit=-1
mssql.batchsize=0
mssql.datetimeconvert=1
mssql.max_procs=-1
msssql.secure_connection = On
and uncommented
extension=php_mbstring.dll


Then I wrote the following code

$myServer = "ITDEPTCOMP2";
$myUser = "sa";
$myPass = "password";
$myDB = "Northwind";
while(!$connection){
@$connection = mssql_connect('ITDEPTCOMP2','sa','password');
}
echo "connect";
$db = mssql_select_db('Northwind',$connection) or die("Error selecting the database");

But it is not working.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!