SQL Get the 5 newest public albums

martijntijn

Joined: 2005-12-02
Posts: 12
Posted: Sun, 2009-10-18 21:21

For dynamic implementing of http://www.flashyourweb.com/article.php?story=mini_slideshow into my website i wish to retrieve the 5 newest AlbumID`s from my gallery. But these albums must also be public.

Right now i`m using this SQL, which ignores security, but just gets the 5 newest ID`s:

Quote:
$query = " SELECT * FROM db.g2_AlbumItem ORDER BY `g2_AlbumItem`.`g_id` DESC LIMIT 0 , 5 ";

How can i build a SQL query that checks if the ablum is public?

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2009-10-18 23:20

You know you can already do dynamic albums like latest updates?
http://www.flashyourweb.com/staticpages/index.php?page=mini_2.0.5#mediaRss

And don't forget to use the handy embed tool ;)

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2