tripleM Posted November 26, 2009 Share Posted November 26, 2009 Hi All, I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which is running smoothly on a system in UK. I got the code and database backup from the Production Server. Restored the DB backup and table names are like sf.tablename and dbo.tablename. Same structure i got in my local system. When i try to run the application, i am getting error DBConnect Failed. I analysed the problem and made changes to a very first query like prefixed the schema name to the tablename in the code. for example select user from sf.Users. Then login and validation done succesfully. But i cant change it everywhere. and its not required as in the production its running without the schema name. So i am not sure if any change is required on SQLServer side. So pls let me know if any configuration/setting is required from SQLServer side? Thanks, tripleM Quote Link to comment https://forums.phpfreaks.com/topic/182999-accessing-data-from-sqlserver-with-php-codecomplex/ Share on other sites More sharing options...
tripleM Posted November 26, 2009 Author Share Posted November 26, 2009 Hi All, I am tryint to setup a webapplication developed in PHP, Apache2.0 and SQLServer2000 as backend which is running smoothly on a system in UK. I got the code and database backup from the Production Server. Restored the DB backup and table names are like sf.tablename and dbo.tablename. Same structure i got in my local system. When i try to run the application, i am getting error DBConnect Failed. I analysed the problem and made changes to a very first query like prefixed the schema name to the tablename in the code. for example select user from sf.Users. Then login and validation done succesfully. But i cant change it everywhere. and its not required as in the production its running without the schema name. So i am not sure if any change is required on SQLServer side. So pls let me know if any configuration/setting is required from SQLServer side? In simple words, from the PHP code if i run query like " select * from users " is not running . if i modify query in the code like " select * from sf.users ". its working fine. but my query is i wont change it in the code. if i required i will change any configuration on SQLServer. Thanks, tripleM Quote Link to comment https://forums.phpfreaks.com/topic/182999-accessing-data-from-sqlserver-with-php-codecomplex/#findComment-965880 Share on other sites More sharing options...
Gamic Posted December 5, 2009 Share Posted December 5, 2009 Make sure that the user you are using to connect to SQL Server has the correct default schema for his/her/its connection to the database. ALTER USER userName WITH DEFAULT_SCHEMA = sf Alter User Syntax Quote Link to comment https://forums.phpfreaks.com/topic/182999-accessing-data-from-sqlserver-with-php-codecomplex/#findComment-972130 Share on other sites More sharing options...
tripleM Posted December 8, 2009 Author Share Posted December 8, 2009 hi, When i try with the above command, i am getting the following error. Server: Msg 156, Level 15, State 1, Line 1 Incorrect syntax near the keyword 'user'. Thanks, tripleM Quote Link to comment https://forums.phpfreaks.com/topic/182999-accessing-data-from-sqlserver-with-php-codecomplex/#findComment-973252 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.