Storing image paths in mysql, retrieving with php

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Davey Gale
Forum Newbie
Posts: 2
Joined: Thu Aug 26, 2004 12:43 pm

Storing image paths in mysql, retrieving with php

Post by Davey Gale »

Hi, i have created a cms that lets me add, edit, or delete individual entries on my website e.g. news stories. (through php and mysql)

I want to now go up a level and have the ability to add new entries, that will aLso call upon an image. I dont want to store the image in my database, just the image path e.g pointed to my image directory. I dont know how to do this, i have tried, but just get a broken image link, not sure how to code it.

Can anyone point me in the direction of a tutorial that covers this, or can anyone paste any tips or scripts that facilitate this???

Many thanks.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

The easiest way i have found untill now:

http://www.zhuo.org/htmlarea/


It comes down to storing a string/verchar in your database.
And retrieving that sctring, and feeding it to the src of an img tag.
Post Reply