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? 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/183011-mssqlphp/ Share on other sites More sharing options...
tripleM Posted November 30, 2009 Author Share Posted November 30, 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/183011-mssqlphp/#findComment-967984 Share on other sites More sharing options...
dragon_sa Posted November 30, 2009 Share Posted November 30, 2009 cant you just change the table names in the database to be without the prefix, then you dont need to change the code. Possibilities are the pre fixes pertain to various production levels of development, or may have had something to do with a shared environment. Were the table names in this format prior to doing your backup? This really should be in the mysql section its not a PHP question. Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-968004 Share on other sites More sharing options...
tripleM Posted November 30, 2009 Author Share Posted November 30, 2009 As i specified, Prior to DB backup, prefixes are there and its running on the production server. Thanks, tripleM Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-968036 Share on other sites More sharing options...
rajivgonsalves Posted November 30, 2009 Share Posted November 30, 2009 have you selected 'sf' as your default database by using mssql_select_db ? Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-968037 Share on other sites More sharing options...
tripleM Posted November 30, 2009 Author Share Posted November 30, 2009 Hi, got code from the Production Server along with the DB backup. here we are using a setupfile for providing connection details like DBServer name and username, password and other details. Not using the simple command like mssql() i am just trying to restore the application on my system, so iguess no need to change any code except the DB details. Thanks, Majeed Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-968043 Share on other sites More sharing options...
rajivgonsalves Posted November 30, 2009 Share Posted November 30, 2009 Yes it must be something simple check your connection string. Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-968044 Share on other sites More sharing options...
tripleM Posted December 1, 2009 Author Share Posted December 1, 2009 Still not resolved my problem.. Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-968798 Share on other sites More sharing options...
Deoctor Posted December 1, 2009 Share Posted December 1, 2009 hai dbo is the default user that u will have for all the databases. Check with your production team whether they have used any other user while creating the database. like while if there are two users sa and pm, in which sa is the admin user for the database and the mssql.where as the pm is the ordinar user for accessing the database. then there will this problem, to change this one. u need to change the user access of all the tables to which ever user that u are using up. search the check this article. http://msdn.microsoft.com/en-us/library/ms190909.aspx Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-968805 Share on other sites More sharing options...
tripleM Posted December 2, 2009 Author Share Posted December 2, 2009 hi, here username is sf and given permissions to this ordinary user. but still problem persists. Thanks, tripleM Quote Link to comment https://forums.phpfreaks.com/topic/183011-mssqlphp/#findComment-969631 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.