Posted by Gordan on 09/16/05 19:34
when coding an image gallery script there's usually 2 tables - pics and
galleries
every pic has some name, description, yada yada and gallerieID. so when you
wan't all the pics from a certain gallerie all you have to do is "SELECT * FROM
pics WHERE gallerieID = 33"
but often I have a need for other types of galleries like "most popular pics" or
"most recent". still this is very simple because when displaying this pics all I
have to do is "SELECT * FROM pics ORDER BY popularity DESC LIMIT 0, 20"
here comes my question :-)
how to put both types of galleries (lets call them static and dynamic) into one
gallerie table so that I can transparently list images regardless of the
specific query involved?
thanks
gordan
[Back to original message]
|