This is a discussion on PHP/MySQL Image Gallery within the PHP Language forums, part of the PHP Programming Forums category; Hiya, Can anyone kindly help me to get started in creating a PHP/MySQL image gallery, it doesn't have ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
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. john.postlethwait@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. > |
|
|||
|
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. |
|
|||
|
"Harrie Verveer" <newsgroup{remove-this}@harrieverveer.com> wrote in message news:GsCdndZQI9rKbuncRVnyuA@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. |
|
|||
|
"DaRemedy" <demonnet@btinternet.com.nospam> wrote in
news:cl658t$gpp$1@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! |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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 |