sayedsohail Posted January 2, 2007 Share Posted January 2, 2007 Hi,I just wish to know, If i can use multiple databases with my application ie., creating separate database for each of my customers, so they can only see their database and minimize the loading and sql query times. Quote Link to comment https://forums.phpfreaks.com/topic/32569-can-i-use-multiple-databases-for-my-application/ Share on other sites More sharing options...
Shazbot! Posted January 11, 2007 Share Posted January 11, 2007 create a switch($) and have the value connect to the correct database. I don't see why you can't connect to different databases, but I don't think you can connect to multiple databases at the same time. Quote Link to comment https://forums.phpfreaks.com/topic/32569-can-i-use-multiple-databases-for-my-application/#findComment-158545 Share on other sites More sharing options...
MCP Posted January 12, 2007 Share Posted January 12, 2007 You can use multiple databases, but it would probably be easier if you kept a single database -- depending on your application, of course. You may want to look at row level security.Alternatively, you can do multiple databases, even at the same time:$db1 = mssql_connect("localhost","user","pass",true);$db2 = mssql_connect("localhost","user","pass",true);mssql_select_db("database1",$db1);mssql_select_db("database2",$db2); Quote Link to comment https://forums.phpfreaks.com/topic/32569-can-i-use-multiple-databases-for-my-application/#findComment-158810 Share on other sites More sharing options...
nadeemshafi9 Posted January 12, 2007 Share Posted January 12, 2007 MCP is right you never need to use more than one db in an application, people try to use the same db for all there applications so they can easily work together, you can hav endless tables and stuff in one db so why use 2, but yes like MCP say its done like that conect to one do your stuff close connect to another etc or just treat them as two connections Quote Link to comment https://forums.phpfreaks.com/topic/32569-can-i-use-multiple-databases-for-my-application/#findComment-159048 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.