Jump to content

how to connect PHP with MS SQL Server


omersarfraz

Recommended Posts

Hiii All

 

I have some problem to create a connection between PHP and SQL Server. I am using SQL Server 2000 installed in Windows Authentication Mode. And i am tryting to connect with ODBC of name "data".

 

Code is this :

 

<?php

$server='data';

$username='root';

$password='';

$sqlconnect=odbc_connect($server,$username,$password);

?>

 

In Windows Authentication Mode, there are not user and passwords. So i am using root as default user.

When I run this, the following error come :

 

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver]

Login failed for user 'CHAUDHRY\SUPER$'., SQL state 28000 in SQLConnect in C:\wamp\www\test.php on line 8[/i]

 

Please Help me how to resolve this problem.

 

 

:)

Link to comment
Share on other sites

  • 1 month later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.