Permlink Replies: 5 - Pages: 1 - Last Post: 18-Jul-2018 22:45 Last Post By: n'Anders Threads: [ Previous | Next ]
Eoin

Posts: 2
Registered: 22-Oct-2003
MySQL
Posted: 22-Oct-2003 15:31
  Click to reply to this thread Reply
I am moving a collection of photographs on to a charity's website. I am not currently using JAlbum.

Each photograph has an associated entry in a database, currently a MySQL database. The data includes date, author, comments, categories and location for each photograph.
I see from the FAQs JAlbum will accept associated information from a text file. Is it possible to drop this data directly into JAlbum from MySQL? Has anyone here attempted anything similar? Would there be any pitfalls or barriers in trying to do this?

Any guidance or advice would be very welcome. Also, is there a limit on how many photgraphs JAlbum can cope with?
roshangupta

Posts: 72
Registered: 29-Jan-2003
Re: MySQL
Posted: 22-Oct-2003 22:24   in response to: Eoin in response to: Eoin
  Click to reply to this thread Reply
Here's one solution--create a text file by hand or via JAlbum for one of your images. Once you have that first sample text file, you can write a small program to read the information from the MySQL database and create similar text files for every image.

Another solution (time consuming if you have a lot of photos) is to manually create the text files yourself, and just query the MySQL database and literally cut-and-paste the info.
n'Anders

Posts: 558
Registered: 22-Jul-2003
Re: MySQL
Posted: 22-Oct-2003 22:55   in response to: Eoin in response to: Eoin
  Click to reply to this thread Reply
If you have access to a database then you're probably on a server that supports some sort of server-side scripting like php or asp, right?

If so, then you could use JAlbum to output php/asp pages instead of static HTML. Just add some code that queries the database for the information given the filename.

Check out the "Bypassing scriptlets" section in the wiki developer docs to see how to output scripting tags needed for asp or php.

Oh - don't forget to change the page extension for your file (the advanced tab in JAlbum)
//Engblom

Eoin

Posts: 2
Registered: 22-Oct-2003
Re: MySQL
Posted: 23-Oct-2003 13:13   in response to: Eoin in response to: Eoin
  Click to reply to this thread Reply
Thank you for your advice, I will explore these options.

The first suggestion to "create similar text files for every image" sounds a little long winded and not my idea of geting the machine to do the work! My initial port involves 1000 photographs. There is an estimate of 10,000 unique images in the final project. If text files were the only option then JAlbum would not be my choice of software.

Regarding the second post from Engblom: yes you are correct, I have "server-side scripting like php". My initial work has relied heavily on the scripting facilities. The fact that JAlbum supports scripting is the answer I was looking for - thanks. I will investigate this and post my results.
p.s. you have a cool name :)

roshangupta

Posts: 72
Registered: 29-Jan-2003
Re: MySQL
Posted: 23-Oct-2003 16:43   in response to: Eoin in response to: Eoin
  Click to reply to this thread Reply
I like Engblom's solution as well, I'd go with that one.

As far as text files, however, the computer will still do all the work. You'd just have to write a little routine that queries the database for each image's information and spits it out to a text file. Once you set up the first one, the rest is automated. However, this solution is only useful if you plan to get rid of the MySQL database, which now I understand you intend to keep.

Good luck!
n'Anders

Posts: 558
Registered: 22-Jul-2003
Re: MySQL
Posted: 23-Oct-2003 17:17   in response to: Eoin in response to: Eoin
  Click to reply to this thread Reply
Me and all my ancestors are glad that you appreciate the family name! :)
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums