08-13-2007, 06:25 PM
I really need help. I am trying to connect PHP to a MSSQL database but I can't get it to connect. I'm using mssql_connect() and have supplied all the arguments but still no joy. Kindly help if u can as I have a deadline on the 17th of Agust 2007.
08-13-2007, 08:11 PM
Are you sure you're using the correct parameters? Are they in the correct order?
08-16-2007, 11:10 AM
this is an excerpt of my code:
$conn = mssql_connect("server_name", "username", "password");
I tried printing the connection string to screen (echo $conn) but it gives a blank screen - which indicates an error because I have other echo statements on the page.
A colleague advised I should use:
just before the mssql_connect() function. I have also tried this but still no joy.
08-16-2007, 01:28 PM
Check your server log. You should be able to see your error message there.
Alternatively, instead of calling mssql_connect with hard-coded parameter values, assign values to variables for each of those parameters and use the variables as arguments for your function. Echo each of those variables prior to calling mssql_connect. For example:
$server = "server_name";
$user = "username";
$pwd = "password";
echo $server . "<br>";
echo $user . "<br>"
mssql_connect($server, $user, $pwd);
You might also change the above code to echo those variables one at a time, to perhaps further isolate the source of the problem.