Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help me please to connect to DB!

Author  Topic 

Naseko
Starting Member

3 Posts

Posted - 2009-03-17 : 06:02:03
Hello everybody.
Firstly - sorry for my English, it's not my native language.

? have a problem:
I need to connect and work with my DB via php.
But when i'm trying to connect to DB, it says something wrong.
Here is my php-code:
quote:
$server='QWERTY\SQLEXPRESS,1433';
$username='sa';
$password='mypass';
$sqlconnect=mssql_connect($server, $username, $password);
if ($sqlconnect!=FALSE)
mssql_select_db("MYDB",$sqlconnect);
mssql_close($sqlconnect);


and here are the warnings (sorry, the first one was translated into English by me, as it was on my language firstly, so, may be the original text of this mistake differs from this one.):
quote:

Warning: mssql_select_db() [function.mssql-select-db]: message: Server-participator "NT AUTHORITY \ IUSR" is not able to apply to the database "MYDB" because of the current security context. (severity 14)(severity 14) in C:\inetpub\wwwroot\test.php on line 12
Warning: mssql_select_db() [function.mssql-select-db]: Unable to select database: MYDB in C:\inetpub\wwwroot\test.php on line 12

And please sorry if this question is not for this forum

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2009-03-17 : 06:17:01
I am not well-versed with PHP, but it seems like your NT ID doesn't have permissions to the MYDB database. Ask your system DBA to give your NT credentials access to the desired database.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Naseko
Starting Member

3 Posts

Posted - 2009-03-17 : 06:24:25
MS SQL Server is installed on my PC. So, i'm an admin =) Can you explain me please how to give access credentials? or where to read about it?
Go to Top of Page

Naseko
Starting Member

3 Posts

Posted - 2009-03-17 : 12:40:54
UPD: i've made a login for NT AUTHORITY\IUSR in Managment Studio, but it doesnot helped(
Go to Top of Page
   

- Advertisement -