473,800 Members | 2,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP/MySQL Image Gallery

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
9 3401
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
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
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
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

"Harrie Verveer" <ne************ ********@harrie verveer.com> wrote in message
news:Gs******** ************@ze elandnet.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
"DaRemedy" <de******@btint ernet.com.nospa m> wrote in
news:cl******** **@hercules.bti nternet.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.co m/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
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

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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11768
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
0
2145
by: Neculai Macarie | last post by:
Hi! Using Union and Order By gives strange behaviour in the following test-case: drop table if exists gallery; drop table if exists gallery_categ; # create test tables create table gallery (d_image_small char(100), d_image_big char(100)); create table gallery_categ (d_image char(100)); # insert test data
11
2387
by: Jane | last post by:
Hi, I need some help (php rookie) to build a thumbnail page using php. I'v a mysql database containing links to the original image files. No thumbnails created so far. It would be nice when the thumbnail contains a link to the original file :-) Jane
5
1738
by: lilkev | last post by:
Hey, I'm new to MySQL and web development as a whole. I designed and put up a website at ArtistsVale , effectively the bulk of the site is an Image gallery which I created through Fireworks/Dreamweaver/Painter. I have a problem, however, with my gallery list on the site. I wanted to create the ability to reorder the list in my administration, however I've got no idea how to go about it or where to start. I contemplated messing with the IDs,...
0
4202
by: numbnutz | last post by:
Hi, I am currently working on an XML Gallery for my girlfriend's brother who is a photographer. I have created a flash front end template and am using an XML database to load the images and accompanying captions. The gallery has more than one image and the user can navigate the gallery by clicking forward and backward buttons to take then through the images: var galleryXML = new XML(); galleryXML.ignoreWhite = true;...
10
6779
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE from Netscape. IE is ok but the Netscape browser including Firefox and Safari are not working now. Not sure why. The idea is that when you mouseover the arrows the gallery div moves to left and right. I have changed the script and now the image...
1
3608
by: cumupkid | last post by:
II am trying to create a form that will allow me to upload photos to a folder in the site root directory and add the information to the mysql db at the same time. I have created two forms, one that uploads to photo to the folder in the site root diorectory. One that uploads the info to mysql database. but... When I try to upload them both ways at the same time i cant get it. I am Including code for both pages i have working. Code for...
11
10826
by: nse111 | last post by:
<?php //header('Content-Type: image/jpeg'); header('Content-Type: text/html'); @mysql_connect("localhost","root","dba") or die("Error"); @mysql_select_db("gallery"); $result = mysql_query("SELECT * FROM paintings"); while($row = mysql_fetch_assoc($result)){ print $row."</br>"; //print $row; }
8
9865
johngault
by: johngault | last post by:
I've been working with this PHP page for several days now and I'm stumped. The page is supposed to allow the user to upload up to six images for their profile. When the user adds an image it (the page coding) does verify file size, if correct it places it on the server in the users folder and with the correct names and extension, creates the thumbnail and adds the correlating file name. However, it only adds the first file name to the database....
0
10495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4148
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.