?
Solved

general advice need with storing pictures

Posted on 2004-03-31
5
Medium Priority
?
215 Views
Last Modified: 2012-05-04
Hi,
I am going a website, for a real estate company. So, each property they have listed on the site, will have a number of pictures for the property. Properties will be deleted from time to time, and added from time to time. I'l like my pages to be dynamic, but i wont always know the names of the files produced , i'm using a mysql back end, and php to generate my html, can anybody give me gernal advice to make this is easy as possible????? i will be writing scripts for the admin of the site also..... there's a lot of points on offer for this, so best overall or even source wins!!!!!

many thanks
0
Comment
Question by:irishprogrammer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
jkna_gunn earned 1600 total points
ID: 10722746
i would upload the pictures and store them in a directory of your choosing. when they are uploaded you can dynamically rename the pictures if you want, if not you can use the name of the file that was uploaded, so the path to the directory where you store the images plus the name of the picture will be stored in the DB.
0
 

Expert Comment

by:halexic
ID: 10730215
Fine example that is working you can see at http://www.kvadrati.com/ 
I store picture file names and picture captions in "image" sql table. Picture files (GIF, JPG) I store in one directory on my website (I have made it).
In my PHP file that has settings for my website I have defined a path to that directory.

Example:
define("UPLOAD_DIRECTORY","http://www.yoursite.com/pictures/");

When you uploading picture real file goes to this directory and name of the picture goes to "image" SQL table in "filename" column and picture caption's (some free text as picture description) goes to "caption" column.
I make small modification to original picture filename (before saving it to database) by adding unique image "id" as prefix (this is primary key "id" of "image" SQL table).

Example:
If your original picture name is "house.jpg", I first find the next primary key in "image" table - suppose I have found that it is "236" and than I store this picture name in "image" table as "236_house.jpg" so you will always have a unique picture name in database... I also save real picture file with this modified name in my picture folder...

Hope this help
0
 
LVL 6

Expert Comment

by:jkna_gunn
ID: 10730333
is that not just what i said? but in less words
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question