"insert into" query to create albums. Can it be done?
andreste
Joined: 2006-06-02
Posts: 123
Posted: Fri, 2006-10-20 13:18
hello,
I have to create about 300 albums so I'm wondering if using an "insert into '....'" query directly to the database could work.
I don't want to screw up things, so I'm asking first.
you should use the Gallery API, not SQL statements. the G2 sql schema and the dependencies are not obvious. only by using the API you ensure that you don't corrupt the data integrity of your database.
you can build a script with GalleryEmbed::init, GalleryCoreApi::createAlbum, GalleryEmbed::done.
see documentation -> API -> GalleryCore -> GalleryEmbed, GalleryCoreApi.
Thanks Valiant, I'll use the Add from server function. I thought it could be used for photos only, not whole directories, so I actually forgot about it altogether; until now!
thanks again!
Posts: 32509
you should use the Gallery API, not SQL statements. the G2 sql schema and the dependencies are not obvious. only by using the API you ensure that you don't corrupt the data integrity of your database.
you can build a script with GalleryEmbed::init, GalleryCoreApi::createAlbum, GalleryEmbed::done.
see documentation -> API -> GalleryCore -> GalleryEmbed, GalleryCoreApi.
Posts: 32509
also consider:
- http://codex.gallery2.org/index.php/Downloads:Galleryadd.pl_NG
- add item from server
Posts: 123
Thanks Valiant, I'll use the Add from server function. I thought it could be used for photos only, not whole directories, so I actually forgot about it altogether; until now!
thanks again!