StroiX Posted March 17, 2008 Share Posted March 17, 2008 Below I have two blueprints that I am wanting to select one from. Being new to MySQL and PHP my biggest downfall is being able to see how well which one would work in the future than the other. Model #1 Customers ---- Company#1 -------- Name -------- Address -------- Phone ---- Customer#2 -------- Name -------- Address -------- Phone Reports ---- Old_Issue -------- Status -------- Text -------- Reporter_Name -------- Reporter_Location ---- New_Issue -------- Status -------- Text -------- Reporter_Name -------- Reporter_Location With the above model, I have created two database (Customers & Reports). My question is that does this seem to be a good practice to have all the customers in one database and then all the reports from all the different companys in another database? And how will things work out if I want to delete a company, will I able to link all the reports to that company and delete them as well without deleting the reports from other companys in a safe manner? Will I be able to use a foreign to link companys with their respective reports? Model #2 Company#1 ---- Account_Info -------- Name -------- Phone -------- Address ---- Old_Issue -------- Status -------- Text -------- Reporter_Name -------- Reporter_Location ---- New_Issue -------- Status -------- Text -------- Reporter_Name -------- Reporter_Location With the above model, I will be creating a new database in MySQL for each customer and then everything related to the company under it. If I go this route, will I be able to print a list of all customers with a PHP, MySQL code considering that each of my customers will have their own separate database in which their information will reside. Is it possible to query different database in a single line of code and pick what you want to SELECT from and then echo it? If this is possible, please also provide an example. Well... pretty much I am stuck until I figure which model I should go with. And please feel free to advice a new model if you think there is one better for my situation which allows for greater flexibility and better organization. I don't want to jump into this without having a descent plan and I appreciate all the support that you will provide. I am definitely a beginner at this game and details will be much appreciated. Thank you once again! Quote Link to comment https://forums.phpfreaks.com/topic/96557-need-advice-in-selection-mysql-model-for-use/ Share on other sites More sharing options...
fenway Posted March 17, 2008 Share Posted March 17, 2008 You definitely don't want different databases... in fact, you don't even want different tables for each customer. Just add a customerID field, and tie it to a customer table. Quote Link to comment https://forums.phpfreaks.com/topic/96557-need-advice-in-selection-mysql-model-for-use/#findComment-494158 Share on other sites More sharing options...
StroiX Posted March 18, 2008 Author Share Posted March 18, 2008 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/96557-need-advice-in-selection-mysql-model-for-use/#findComment-494575 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.