Jump to content

Need advice in selection MySQL Model for use


StroiX

Recommended Posts

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!

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.