load image as link from database

images php coding issues or problems here.

Moderators: macek, egami, gesf

jnash
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Apr 03, 2012 4:56 am

load image as link from database

Postby jnash » Tue Apr 03, 2012 5:03 am

i have images ( not link of images ) store in sql database i want to display these images as hyperlinks in php

can anybody help how to do this.

User avatar
gandahar
New php-forum User
New php-forum User
Posts: 112
Joined: Tue Mar 15, 2011 4:05 am

Re: load image as link from database

Postby gandahar » Fri Apr 27, 2012 4:54 pm

hi!

you can try something like this :

Code: Select all

//database query
$image_URL=$result['image_URL']);
echo '<a href="'.$image_URL.'"><image src="'.$image_URL.'"></a>';

User avatar
minimihi
New php-forum User
New php-forum User
Posts: 238
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania

Re: load image as link from database

Postby minimihi » Sat Apr 28, 2012 1:00 pm

You need to have PHP code which would pass image from database to browser window by image ID/name.

Link to images could look like that
http://your_domain.com/image.php?id=35

Inside of image.php you would look up for image in database with 35 as ID, fetch image data, form headers for image and print it.


Return to “PHP coding => Images”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron