php SQL Server mssql_select_db error

Graveman

New Member
Up until yesterday I have been happily connecting to SQL Server Express 2005 using PHP 5 on IIS 7.Yesterday I started getting errors when selecting a database.\[code\]<?php$link = mssql_connect('localhost,1433', 'login', 'password');if(!$link) { die('could not connect to MSSQL');} if(!mssql_select_db('database', $link)) { echo mssql_get_last_message(); die('could not select db'); } ?>\[/code\]This outputs the following:"Changed database context to 'database'.could not select db" So \[code\]mssql_get_last_message\[/code\] is outputting \[code\]Changed database context to 'database'.\[/code\] which seems all correct and isn't really an error message. But then the mssql_select_db is still failing.I have tested the following:
  • The login is correct (you get a different error changing the username or password)
  • The database exists (you get a different error if I use the name of a database that doesn't exist
  • The login can connect to the database (you get a different error if you delete the database user in SQL Server)
I'm not sure what else to test.
 
Back
Top