Jump to content

PHP 5 / XP /IIS 5.1 /MS SQL


ommedia
 Share

Recommended Posts

I have PHP installed on IIS on an XP local server. The MS SQL server is on another box, and is connectable from other applications including .NET.

 

I can't seem to get my connection to work:

 

CODE:

$cur_server = 'DNS_SERV_NAME';

$cur_user = 'sa';

$cur_pw = '';

 

$connection = mssql_connect($cur_server, $cur_user, $cur_pw)

or die("Could not connect: ");

 

$dbname = 'db_name';

$db = mssql_select_db($dbname , $connection)

or die("Invalid Select: ");

 

$result = mssql_query("SELECT Description FROM Powers WHERE Valid_Flag = 'Y' ORDER BY Description",$connection)

or die("Invalid query: ");

 

 

ERROR:

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: DNS_SERV_NAME in......

 

 

Q1: Any suggestions / references ?

 

Q2: Additionally, with MySQL I've used . mysql_error() in my die(). Is there an equivelant or alternative error specifics function that can be used with mssql functions?

 

Thanks,

Tim

 

Link to comment
Share on other sites

  • 4 weeks later...
This thread is more than a year old.

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.

 Share

×
×
  • 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.