SunQuest
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 2nd, 2005, 03:04 AM
perlnewbie23 perlnewbie23 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 105 perlnewbie23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 41 sec
Reputation Power: 4
HELP: Can't display image.

Hi, I'm trying to display an image from my database but the image can't be seen. Here is my code:

PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<
html>
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<
title>Air Jordan 1</title>
</
head>

<
body>
<
cfquery name "aj1shoelist" datasource "shoes">
SELECT imageURLnamebranddetailspricesizecolor 
from Shoe WHERE name 
'Air Jordan 1'
</cfquery>
<
cfoutput query="aj1shoelist">
<
p><img src "#imageURL#" alt="Image"/> </p>
<
p>&nbsp;</p>
<
p>&nbsp;</p>
<
table border="1" width="801" height="170"
    <
tr>
    <
td width="90" height="21"><strong>NAME: </strong></td>
    <
td width="699">#name#</td>
    
</tr>
    <
tr>
    <
td height="21"><strong>BRAND: </strong></td>
    <
td>#brand#</td>
    
</tr>
    <
tr>
    <
td height="21"><strong>DETAILS: </strong></td>
    <
td>#details#</br></td>
    
</tr>
    <
tr>
    <
td height="21"><strong>COLOR: </strong></td>
    <
td>#color#</br></td>
    
</tr>
    <
tr>
    <
td height="21"><strong>PRICE:</strong></td>
    <
td>#price#</td>
    
</tr>
    <
tr>
      <
td height="26"><strong>SIZE:</strong></td>
      <
td><SELECT NAME="Size">
        <
OPTION>Select a size</OPTION>
        <
OPTION VALUE="#size#">#size#</OPTION>
      
</SELECT></td>
    </
tr>
    <
tr>
    <
td height="21">&nbsp;</td>
    <
td>&nbsp;</td>
    </
tr>
</
table>
</
cfoutput>

<
a href="Welcome.htm">Home</a>
</
body>
</
html


Thanks!

Reply With Quote
  #2  
Old March 2nd, 2005, 07:06 AM
Black Adder Black Adder is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 16 Black Adder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 47 m 27 sec
Reputation Power: 0
Have a look at the URL, which is tried to be displayed. (right klick the image spaceholder and select properties)
Is that URL the one it should be?

Reply With Quote
  #3  
Old March 2nd, 2005, 08:01 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,626 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 6 m 34 sec
Reputation Power: 53
As I noted in the other thread, I strongly recommend against storing the image in the database. Store the path and then just use the path to populate an <img> tag when you want to display the image.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old March 2nd, 2005, 09:34 AM
Black Adder Black Adder is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 16 Black Adder User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 47 m 27 sec
Reputation Power: 0
Is he storing the whole image in the database?
I assumed he is storings a path, because of the fieldname 'imageURL'.

Reply With Quote
  #5  
Old March 2nd, 2005, 10:29 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,626 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 6 m 34 sec
Reputation Power: 53
Yes it looks like you're right. If there is a problem then it is with the path he's using for the image. It must be a relative path or absolute path, not a full system path (unless you plan on deriving the web path from the system path which is more complicated).

Absolute paths are easiest, so the path should be something like:

"/images/myimage.jpg"

This depends of course on your actual directory structure.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > HELP: Can't display image.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway