Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Warning: MS SQL: Unable to connect to server

Status
Not open for further replies.

sebsol

Technical User
Aug 25, 2003
8
FR
Hello all,

I have a weird problem on a PHP site.
This site has a administration part. The admin accesses the MS SQL 7.0 with the same string than the site, the same file. The site is working fine but I get this on the admin:
Warning: MS SQL: Unable to connect to server: OUR DATABASE in E:\site\databasecall.php on line 6
Not working

The databasecall is the one used by the front office and the back office:
<?
/*This is the database connection for the galderma website*/

$db_conn = mssql_connect(&quot;OUR DATABASE&quot;,&quot;**&quot;,&quot;**&quot;) or die (&quot;Not working&quot;);
mssql_select_db (&quot;db&quot;,$db_conn) or die (&quot;&quot;);
?>

Anybody, any idea, any how, anywhere, anyway?????

Thanks.

Seb
 
A note on the side:

Why are you acessing the site with the same credentials as the administrator? Isn't that undesirable?

I assume that the database server has some logs. Look in there for entries for the failed attempt. If there is nothing in there the connection failed before MSSQL got involved.

You should also use mssql_get_last_message to learn more about the failure.
 
Thanx DR and sleip,

Sleip, indeed OUR DATABASE is for security reason ;-)
DR, I didn't build the code and I would have had 2 users as you mentionned. For the logs, unfortunately, I'm trying to troubleshoot from the distance and I can't have access to them and it will be hard to get them but I'll try.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top