By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,716 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,716 IT Pros & Developers. It's quick & easy.

PHP/MySQL Image Gallery

P: n/a
Hiya,

Can anyone kindly help me to get started in creating a PHP/MySQL image
gallery, it doesn't have to be anything fancy, just something that
automatically reads the images in the folder and displays it.

Cheers
DaRemedy
Jul 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
DaRemedy wrote:
Hiya,

Can anyone kindly help me to get started in creating a PHP/MySQL image
gallery, it doesn't have to be anything fancy, just something that
automatically reads the images in the folder and displays it.

Cheers

DaRemedy


Try http://gallery.sourceforge.net/
--
The facts, although interesting, are irrelevant.
Jul 17 '05 #2

P: n/a
Why do you need the images in a database if you are already reading
them from a folder? It is kind of redundant... Unless I am missing
something.

Jul 17 '05 #3

P: n/a
no not necessary, with the dir() method you can find images (and open
them/display them/delete them), but mostly I keep the filenames in a
database because I often like to have some administration with my
images; like the owner, the gallery it should be displayed in, a
discription of the image, location of the thumbnail, a one to many
relation with a users comments table. In that case it is just easier to
keep the filenames in the database. As long as you add the images when
uploaded, and unlink() them when removed from the database, there
shouldn't be any problem.

jo***************@gmail.com wrote:
Why do you need the images in a database if you are already reading
them from a folder? It is kind of redundant... Unless I am missing
something.

Jul 17 '05 #4

P: n/a
DaRemedy wrote:
Hiya,

Can anyone kindly help me to get started in creating a PHP/MySQL image
gallery, it doesn't have to be anything fancy, just something that
automatically reads the images in the folder and displays it.

Cheers
DaRemedy


Nothing to do with your request admittedly, but you should check out
http://www.flickr.com if you havent already.

It's SERIOUSLY good - and the online community aspect has to be seen to be
believed.
Jul 17 '05 #5

P: n/a

"Harrie Verveer" <ne********************@harrieverveer.com> wrote in message
news:Gs********************@zeelandnet.nl...
no not necessary, with the dir() method you can find images (and open
them/display them/delete them), but mostly I keep the filenames in a
database because I often like to have some administration with my
images; like the owner, the gallery it should be displayed in, a
discription of the image, location of the thumbnail, a one to many
relation with a users comments table. In that case it is just easier to
keep the filenames in the database. As long as you add the images when
uploaded, and unlink() them when removed from the database, there
shouldn't be any problem.

What I originally wanted to do is to have the image path stored in a
database and the php page retrieving them. Only problem is that I have about
200 images so inputting them all into a database is going to be one long
task. How would you suggest I approach this?

Thanks.
Jul 17 '05 #6

P: n/a
"DaRemedy" <de******@btinternet.com.nospam> wrote in
news:cl**********@hercules.btinternet.com:
What I originally wanted to do is to have the image path stored in a
database and the php page retrieving them. Only problem is that I have
about 200 images so inputting them all into a database is going to be
one long task. How would you suggest I approach this?

Thanks.

throw all the files in any directory.

write a php script that reads the names of the image files in the directory,
then appends the 'real' path to the front of them (ie: the script changes the
variable from "butter.jpg" to "http://www.yoursite.com/path/to/butter.jpg")

the same script then takes the new name and puts it where you want in your
database.... loop it 200 times (or once for each file in your directory) and
voila!

good luck!


Jul 17 '05 #7

P: n/a
Yeah, that is what I would do, you may even want to make it modular so
you can reuse it later, for instance have it ask you what the absolute
URL to the image folder is before it appends the URL (as opposed to
hard-coding the URL)

Just use foreach() to make it loop through every file in the directory
for the number of files in the directory.

Jul 17 '05 #8

P: n/a

DaRemedy wrote:
Hiya,

Can anyone kindly help me to get started in creating a PHP/MySQL image gallery, it doesn't have to be anything fancy, just something that
automatically reads....


do more with less, Robopages:
http://www.phpclasses.org/browse/package/743.html

Jul 17 '05 #9

P: n/a

DaRemedy wrote:
Hiya,

Can anyone kindly help me to get started in creating a PHP/MySQL image gallery, it doesn't have to be anything fancy, just something that
automatically reads....


do more with less, Robopages:
http://www.phpclasses.org/browse/package/743.html

Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.