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.
Did you know?Explore Trending and Topic pages for more stories like this.

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
No comments posted yet

Your Answer:

Login to answer
264 Like 29 Dislike
Previous forums Next forums
Other forums

Please Help my PHP Dating Function.
Hi everyone!

Well here is my code that displays this:

It works wonderful.


OPINIONS WANTED
This is my login page code, and I want your opinion on it please!

Code: // Login ~ CHECKS

HTML Form Server Side Validation
Hi, Im new here, im currently doing a website for a friend, and I have designed using snippets from

Varible in trigger - refering to correct schema
Hello

Im having some issues with my trigger.
What I want to do is call opon a differ

Displaying an image using echo command
I had done a query on my database, one of the fields being an image reference to a directory where a

Does design fit in FPGA ?
Hi all,

I've made a large HCC-Design. Because of the program-size the compile process with th

SHOW TABLES Help
Hi all

I have the following

Code: [Select]<?php
$sql = "SHOW TABLES&quo

Email logic not working
I would like to send an email using the php email() function then if it does execute i.e sends i wou

database design
Hi,

I got a page which allow candidate to type in their previous working experience,
I let

Error in SQL Syntax HELP!!!
I have this page:

Code: <?php

session_start();

//connect to server and s

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