Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > MySQL
| Search | Today's Posts | Mark Forums Read
MySQL General discussion about the MySQL database.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the MySQL 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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 26th, 2005, 12:29 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Images and MYsql

Hello
OK, even though I'm a newbie I have managed to set up a 5000 photo record database and retrieve information from that database and display it in my web browser.

However, the only info I've been successful in displaying is the text info pertaining to the photo but I would like to display a photo (maybe 2 photos) along with the text info.

I will only be displaying one record at a time..when the page loads it will display a photo and all the text information about the photo.

I have read many articles on the web about not storing images in your database that it's better to store the URL to the image. That's fine by me I'll be glad to store them in a folder on the server.

But, in all the articles I've read I still haven't seen an explanation on how to do this. So, can someone tell me how to store the URL or hyperlink or whatever it is that will allow me to get an image to display.

I don't a link to the photo to be displayed but the photo itself.

I have managed to get this far by reading and taking some online courses on PHP and MYsql but none of them covered this. So any help will greatly appreciated I'm really stuck.

Background Info
PHP4.3.1
MYsql 4.1.9
PHPmyadmin 2.6

Thanks

Reply With Quote
  #2 (permalink)  
Old March 16th, 2005, 12:36 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Yah, you use your php to write some html like:
 <img src="$URL_OF_IMAGE" alt="comment">

The $URL_OF_IMAGE is the URL that you stored as a field in your database. The web browser that connects to this page then figures out decoding the image at that path for you.

You might want to take a look at the source of slooze (http://www.slooze.com ) which is a simple php photo album that works this way - I use it myself!

HTH

--
Don't Stand on your head - you'll get footprints in your hair. http://www.charlieharvey.org.uk
Reply With Quote
  #3 (permalink)  
Old March 16th, 2005, 12:38 PM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

sorry, forgot to say the url should be in the format:

http://your_web_server_root/path/to/image.jpg

--
Don't Stand on your head - you'll get footprints in your hair. http://www.charlieharvey.org.uk
Reply With Quote
  #4 (permalink)  
Old April 5th, 2006, 10:32 AM
Registered User
 
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Shelbali
Default

Hi Guys,

I'm having a similar problem. I'm new to phpmyadmin and mysql, etc. I've created my database and tables and now i want to add images to my tables. I too am happy to point to a url if my site will display the picture 'not' the url.
I've managed to display the image in phpmyadmin under the structure of the database, but I cann't get it to show on my webserver. The field I want the picture to be displayed in just shows the file path of the picture. Do I have to add that image source html code to Dreamweaver, or in phpmyadmin?
many thanks for your help, please be patient with me, i know very little about dynamic websites!

Cheers
Alison:)

Thanks :o)
Reply With Quote
  #5 (permalink)  
Old April 5th, 2006, 11:17 AM
Registered User
 
Join Date: Apr 2006
Location: , , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Shelbali
Default

I have it working. Thanks very much - I added the code like you said into the varchar field of the phpmyadmin and heypresto!!! Many thanks I'm over the moon!!! :D

Thanks :o)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dispalying images from the database mysql amisrivas JSP Basics 3 February 15th, 2008 01:56 AM
How to insert images to MySQL (BLOB) wkm1925 ASP.NET 2.0 Professional 0 November 19th, 2006 06:29 AM
Displaying images stored in MySQL through in PHP trufla PHP Databases 3 May 2nd, 2006 04:55 AM
HELP - Displaying Images from mysql timmaher Beginning PHP 5 January 26th, 2005 03:09 PM
displaying images from mySql DB in html cmcmillan.schillers Beginning PHP 1 October 5th, 2004 03:52 AM



All times are GMT -4. The time now is 12:02 PM.


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