Jump to content

MSSQL/PHP


tripleM

Recommended Posts

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 >:(

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

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