Hi, this question is more theoretical, and it probably exposes the fact that I have much to learn in respect to MySQL. I can insert, update, and select and have no problems, but this is much more complicated than I am used to:
I have a DB with four tables:
1) organizations
2) events / actions
3) votes
4) contact info
I have a page where I need to show a summary, and all the information is inter-dependent from one table to another.
The question is:
Is it wiser to do small little queries for each bit of information when building the page (maybe eight to ten small queries and print as I go...)
OR
is it faster/more optimal/better form to query the db as few times as possible and store the info into variables and arrays and then plug them into the page as needed.
(three queries and save the data in varialbles/ arrays and then tap those values as needed in the page)
Here is what I am trying to accomplish:
1) Determine if there are any events/actions for the specified time frame FROM actions
2) Determine what the specific actions/events are FROM actions
3) Determine all the organizations in the db
4) Determine how the organizations Voted / Supported the actions/events (3 options)
??
Any thoughts on how to go about constructing a page built upon several queries would be appreciated.
Thanks!