PHP - Dababase Theory
I have created a system that uses an API to drop utility data into MSQL Server 2008. Once the data is in the db, a web app can query the data to create electric bills. Currently we are working with only one customer but are entertaining expansion and want to approach the growth from the best possible angle.
Considering that all data is the same type of data but comes from different customers and sources, would it be best to maintain 1 database with all of the utility meter data streaming to it or would it be best to have a new data base with each customer?
Also, assuming we keep it all in the same database, would it be best (assuming we are secure) to have all the individual customers data go to the same tables or have separate tables for separate customers.
I'm pretty certain I know the answer but I'm a novice so that means nothing.
Thank you for any help with this issue.
Edited by Butterbean, 18 November 2014 - 11:28 AM. Similar TutorialsAlthough this is the PHP coding section i couldn't think of a better place to post this, it has more to do with theory or a way for me to achieve what I want rather than a piece of code which I cant get to work. I have been working on this project, sort of a note taking application. When a new note is added to the database, after the ajax, the page is refreshed and then the new note appears along with the note title in the navigation pane. My problem is when I put the site up on my web server it runs more slowly so when the page is refreshed after the ajax the data is not yet in the database so it needs a second manual refresh for the data to appear. I tried delaying the refresh a tenth of a second and it sort of worked but I ran into problems when actually trying to implement it. But after getting frustrated, I have decided that my refresh workaround isn't very elegant. Is there a technique or method I could use to have certain parts 'refresh' without actually refreshing? I'm sure it is possible and probably quite simple I can think of lots of times when this sort of thing would be needed. Even just making a comment on facebook the whole page isn't refreshed, it just appears. Or rather somehow knows there is new data in the database and updates its self. But this is my first real php project so I'm still learning how everything is done. Hey guys, I have been programming for a while and I want to know what sort of design patterns I should look into when making a game? For example what design pattern is best for: Database management User management Forum management Etc I can only think of singleton or factory (for user/forum) I am reasonably new to OOP, but would like to learn it properly, so I thought creating a simple program such as rock-paper-siccors would work to be able to expand it eventually, and hopefully it will teach me reusable code practice. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=357178.0 Hello, I am fairly new at php (have been using HTML/CSS for a while but recently learned the php basics). I am building a website to allow clients to schedule through multiple massage therapists and I am struggling with the basic beginings of a scheduler scripts. If someone can point me towards a tutorial or script that would be great, or answer any of the following questions: 1. What would be the best way to store each therapists weekly schedule (based on monday-sunday with start and end times) and propagate that info. to every day that a client might schedule on? 2. How do i get the day of the week based on the date? 3. How do i display a calendar that lets them choose the date? I have an audio mix submitting form on my website. The first part of the form takes the details from the user and inserts a new row in the first table 'mix', auto incrementing to generate a mix_id primary key. The second part then uses a series of check boxes to select which genres the mix contains and a foreach for the resulting array to insert, into the 2nd table 'genres_for_mix', a new row for each genre id (foreign key for the genres table) that is selected and the mix_id that it concerns. Now I'm starting to think this is a bad way to do this because: 1. I don't know how to echo this out when a user edit's the mix to make all the relevant checkboxes selected. 2. When a user deselects a choice, it would be quite long winded to delete the nessesary row. So instead I'm thinking that it would be much wiser to user the serialise functions to put the array into the database However, I still don't know how to make the right checkboxes selected when I echo out the edit form. Do I use something like inarray()? If so how? Also, it's really important that I can query the database for mixes that are associated with a specific genre. Without unserialising the array and therefore echo'ing out all the results, I don't know how to query this. Would I just use a 'WHERE genre_field LIKE 'genre_id'? Can anyone help me with this please? Hello everyone, I'm in the process of creating a PHP script (will be open-source), I just need to know how to make it easy for people to add plugins? Like I don't really know much about the concept of plugins (how they should work), all I know is that there should be a function to activate / deactivate the plugin, but how can I make it possible for people to run their "code" wherever they want? I've heard about "hooks" but I don't really understand how this should work, anyone can explain please? Thank you very much in advance |