gunlomboy Posted May 6, 2008 Share Posted May 6, 2008 Hi, We are running a now quite outdated PHP installation (4.3.0) on W2K with MSSql. The PHP is working fine and I can connect to the sql server without any problems. However, I can only successfully run queries if I use the database name in the query. Eg. SELECT * FROM person ..... fails with this message: Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'person'. (severity 16) BUT .... if the query is SELECT * FROM database_name.person ..... it's works fine I am using mssql_select_db('database_name') immediately after I connect, but it doesn't seem to do anything. ----------------------------- $conn = mssql_pconnect($sqlserver , $sqluser , $sqlpass); mssql_select_db($database); $result = mssql_query("SELECT * FROM person", $conn); ------------------------------ Any ideas? Thanks Jon. Quote Link to comment Share on other sites More sharing options...
gunlomboy Posted May 6, 2008 Author Share Posted May 6, 2008 Just discovered that all my queries work fine if I connect to the Northwind database ie. I don't have to put the database name in the query .... BUT .... my database still requires the db_name in there. Any help would be appreciated. Tks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.