For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > September 2005 > image gallerie









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author image gallerie
Gordan

2005-09-16, 6:57 pm

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


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com