I am designing a web application using php and mysql. I have a little doubt in database.
The application is like
- Users get themselves registered.
- Users input workload (after login ofcourse 🙂 ).
- User logs out.
Now there are multiple types of inputs which i accept on a same form. Say there are 3 types of inputs and they are stored in 7 different tables (client requirement 🙁 )
Now my question is what is the best way to fire a query after inputs are done ?
For now i can think of following ways.
- Fire 7 different queries from php
- Write a trigger to propagate inputs in appropriate tables ?
Just guide me which approach is performance efficient ?
Thanks 🙂
Generally you want to stay away from triggers because you will be penalized later if you have to load a lot of data. Stored procedures are the way to go. You can have different conditions set to propagate inputs into different tables if needed.