Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2007, 06:33 AM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default retrieving an image from a mysql db

how do i display an image saved on a mysql database

 
Old March 13th, 2007, 08:01 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

What you need to do is make a select query that selects a record from a table.
In that table on of the fields must have a image Url(You can't store an image into a mysql database).
so your query would look something like the following
Code:
Select image_url from images where image_id=1;
when you have retrieved the url its just a matter of doing a echo like:
Code:
echo("<img src=\"".$imageUrl."\" />)
hope that helped

__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
 
Old March 16th, 2007, 12:59 PM
Authorized User
 
Join Date: Feb 2007
Location: , , India.
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

fine reply man,....surely did clarify my doubt.
thanks..





Similar Threads
Thread Thread Starter Forum Replies Last Post
sending and retrieving image to/from sql mosi C# 2005 1 May 10th, 2008 07:51 AM
Retrieve image data from mysql db vermaarun2005 PHP Databases 0 July 14th, 2007 11:12 AM
Retrieving and uploading image in Database vijay_83 ASP.NET 2.0 Basics 1 October 4th, 2006 03:25 PM
Storing/Retrieving jpgs from MySQL flippyn5 PHP Databases 1 December 9th, 2005 08:15 AM
Inconsistent error when retrieving data from a db darkhalf Classic ASP Databases 2 March 14th, 2004 12:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.