konfused Posted July 15, 2013 Share Posted July 15, 2013 I have a choice of hosting packages with my current host. If I upgrade I can have 5 databases. But as each database is accessed from a home page, I don;t see how 5 index.php files can work. Do I have to put four of the index.php files in separate sub folders? What is the best way of exploiting the capacity for 5 databases? Link to comment Share on other sites More sharing options...
Guest Deleted Posted July 15, 2013 Share Posted July 15, 2013 I'm not sure about other databases but I've never seen a MySQL database that has anything to do with index.php or any other page for that matter. It's a completely separate entity. Now, you can access a MySQL database from a php file but that doesn't mean the two are the same. Hope this helps Link to comment Share on other sites More sharing options...
HartleySan Posted July 15, 2013 Share Posted July 15, 2013 I wouldn't store your PHP scripts in the DB. Furthermore, any number of scripts can access the same DB. In general, one site will have one DB, which will then contain all the tables you need for that site. Link to comment Share on other sites More sharing options...
konfused Posted July 15, 2013 Author Share Posted July 15, 2013 Thank you for your replies. You both misunderstood my question. A website has a home page, either index.html or index.php say. Links on the home page allow users to login or register with a database. As I see it, to utilize five databases the home page would need five different links. In other words, the offer of five databases is of little value. If I want more than one database, I would be would be better off putting each one in separate websites with its own home page.. Link to comment Share on other sites More sharing options...
HartleySan Posted July 15, 2013 Share Posted July 15, 2013 konfused, you don't need five links on a single web page to access one of five DBs. In a PHP script, you could easily choose which DB to use based on the information a user submits without giving the user five different links. With that said, I wouldn't use more than one DB for a single site anyway. However, my hosting company gives me two DBs, and I use them both because one is for my main site, and the other is for side projects and web apps in my portfolio. Link to comment Share on other sites More sharing options...
konfused Posted July 15, 2013 Author Share Posted July 15, 2013 Many thanks Hartley San The site I am using allows an add-on site, his means I can follow your system and access one database from the add-on site and another from the main website, I think that means that the optimum number of databases on the server is two. Link to comment Share on other sites More sharing options...
Guest Deleted Posted July 15, 2013 Share Posted July 15, 2013 Who is your host? Link to comment Share on other sites More sharing options...
konfused Posted July 18, 2013 Author Share Posted July 18, 2013 Buttercream Cupcake I like your cake, The host I referred to is www.bargainhost.co.uk Very popular in UK Link to comment Share on other sites More sharing options...
Guest Deleted Posted July 18, 2013 Share Posted July 18, 2013 Thanks. And hmm, looked at the website but I didn't see any information about those home pages (referring to what you spoke of in this comment, "But as each database is accessed from a home page") Could you take a screen shot and show us? Link to comment Share on other sites More sharing options...
konfused Posted July 19, 2013 Author Share Posted July 19, 2013 You have misunderstood again. There is no home page for accessing five databases. My question was how can I ever make use of five databases? and the question was hypothetical My last reply to Hartley San resolves this .i.e., with the addition of an add-on website I could only ever access two databases, so why is this host offering five?. Link to comment Share on other sites More sharing options...
HartleySan Posted July 19, 2013 Share Posted July 19, 2013 Different people like to break things up different ways. Some people like to have multiple DBs for a site. With the exception of really big sites though, I see this as overkill, personally. In addition to your main site and any add-on sites, you may want to also set up an API for people, which generally requires a back-end DB powering everything. Link to comment Share on other sites More sharing options...
Larry Posted July 19, 2013 Share Posted July 19, 2013 My site currently uses 3 separate databases, although I could easily see there being one or two more. I use multiple databases as a security measure, and to make working with any of them much easier (because I don't have to even look at unrelated tables). The answer to the question of why they offer 5 is that they can. It's a snap to offer that and some customers will appreciate it the extra database possibilities. Link to comment Share on other sites More sharing options...
Guest Deleted Posted July 20, 2013 Share Posted July 20, 2013 Konfused: Oh! I see what you mean now. Well, I use multiple databases, because I have multiple sites. Each site has its own database. These sites do not in any way interact, so it makes sense to have separate databases. If I had everything in one database it could get confusing trying to remember what goes to what site. I also second Larry on this being more secure. If somebody breaks into one database they don't have access to all your data for all your sites. Link to comment Share on other sites More sharing options...
Recommended Posts