I am a newbie to php and mysql. i have a questions.
What's the best way to save images to my database and display them into my php page. I created a page http://www.it2o.com/nadir4, and there are articles that display images within them, so how can i save my images through an upload form, then post them to the database and from there display them into the page? . I created an upload page http://www.it2o.com/nadir4/upload_info.html
Thanks alot...your help is appreciated
Help!!!how can i display images from DB
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
store the filepath to the image instead of the actual image itself, for example store /images/jcart.jpg inside a row.. then when fetching the data
Code: Select all
echo '<img src="'.$row['image_path'].'">';I go to a certain city's meetup and there is a DBA present who brags that he/she has a database with millions of images stored in it. They are very proud of this setup and all the old folks oo and aaa at the fact that she can store so much crap in a database and still have the computer in a somewhat usefull state.
Am I the only one who would never put so many files in a database like that, or am I just a jackass for feeling superior to this man/woman?
It may be harsh, but there seems to be a red sports car effect on databases these days. Meaning people just go for the outside figures: an umpteen thousand rows, uberty-five columns, and shventy-pi indices. Give me a well designed database which is as efficient as possible, and I'll be impressed. Throw a couple terabytes into a database, and I will scoff.
Just my 0.02
Am I the only one who would never put so many files in a database like that, or am I just a jackass for feeling superior to this man/woman?
It may be harsh, but there seems to be a red sports car effect on databases these days. Meaning people just go for the outside figures: an umpteen thousand rows, uberty-five columns, and shventy-pi indices. Give me a well designed database which is as efficient as possible, and I'll be impressed. Throw a couple terabytes into a database, and I will scoff.
Just my 0.02