Storing/displaying image urls in a database?


Posted on 16th Feb 2014 07:03 pm by admin

Hi
Basically I have the following scenario:
User chooses picture from list. Picture info is added into the db, including url.
However I can't figure out how exactly i should be storing the url for the image.

What data type should i use? How to insert it/extract it (with the backlashes/etc neeeded) ? Should I store the full http://www.somesite.com/imageurl.jpg or just somesite.com/imageurl.jpg ? (as little as possible)
How do i then display it?

Had a quick search here...no luck finding what i'm looking for..had a look on google but ended up just finding info on the BLOB data type..which would be inserting the actual image binary data into the database i believe.

Any help?

Thanks

264 Like 29 Dislike
Previous php-forum Next php-forum
Other php-forum

an interesting question
Greetings folks, got to ask an interesting question...

let say
i have created a function s

Beginner PHP code help
Hi I'm new to php but if someone could please read the question below and help it would be great.

Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

PHP File Upload Problem
Hi, I have written a very simple file upload script but it fails for reasons I can't explain. Hope

returning data from an ssh2_exec()
here's what i got.


$conn = ssh2_connect($this->_host);
ssh2_auth_password($c

Any decent php formatter/beautifier/pretty printer?
Any decent php formatter/beautifier/pretty printer class/function?

I found the following whil

start new row of pictures
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get

regex for quoted text within a string
I am still getting the hang of regex expressions, but I cant seem to figure out how I would escape q

Reduce redundancies in switch functions?
Hello all! I somewhat new to PHP, and was wondering if anyone could give some suggestions on a swit

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash