Page 1 of 1

Cannot connect to database

Posted: Wed Jun 03, 2009 12:25 pm
by warriorforgod
I am trying to connect to an mssql database and am getting the following error.

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: nagual.homelinux.net in /var/www/test.php on line 73

I have been give the following connection string to use, but I may not be using it correctly.

nagual.homelinux.net\jv_dwm,400010

Here is my code.

Code: Select all

 
<?php
 
error_reporting(E_ALL);
 
$dbuser='username';
$dbname='database name';
$dbpass='password';
$server='nagual.homelinux.net\jv_dwm:400010';
 
$connect = mssql_connect($server, $dbuser, $dbpass);
 
mssql_min_message_severity(10);
 
?>
 
 
Thanks in advance for any help.

Re: Cannot connect to database

Posted: Wed Jun 03, 2009 12:41 pm
by mikemike
According to the documentation the port number is specified using the syntax <server>,<port> - you're using <server>:<port>.

Try the following code:

Code: Select all

<?php
 
error_reporting(E_ALL);
 
$dbuser='username';
$dbname='database name';
$dbpass='password';
$server='nagual.homelinux.net\jv_dwm,400010';
 
$connect = mssql_connect($server, $dbuser, $dbpass);
 
mssql_min_message_severity(10);
 
?>
 

Re: Cannot connect to database

Posted: Wed Jun 03, 2009 12:50 pm
by warriorforgod
Hmm. Changed and still getting cannot connect.

Re: Cannot connect to database

Posted: Wed Jun 03, 2009 4:19 pm
by califdon
Include the "http://" at the beginning of your URL.