|
Posted by listerofsmeg01 on 11/22/06 00:09
Hi,
Pretty new to PHP and MySQL.
I have a page on my site that displays a lot of information from
various tables. Currently I have lots of small PHP wrapper functions
around SQL queries to get each bit of information. This results in
maybe 10 queries to display one page, but they are all very small and
simple, and it keeps the PHP looking nice too as they are simple
function calls to get each piece of info, which can be called from any
page in my site.
However, after reading up on SQL a bit, I am wondering whether I should
be looking at just generating one large query at the start, and using
joins etc to lump all the relevant info together. This complicates the
PHP as this means a custom query for each page of my site depending on
what needs to be displayed, but I am wondering if it is worth it if I
get a fair performance gain.
Can any gurus point me in the right direction? Is there a "proper" way
to do this sort of thing?
Many thanks.
Navigation:
[Reply to this message]
|