Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 1st, 2004, 11:20 AM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default displaying images from mySql DB in html

Hello,
I'm using dreamweaver mx2004 to develop a website and have been trying to insert an image from a mysql DB and can't get it to work.
Here is the code:
<?php $var1=($row_Recordset1["PROD_ID"]); ?> <?php echo $var1; //for testing ?>
<?php $PROD_ID = $var1; ?>
<td width="150" height="150" align="center" valign="top"><?php echo ("<img src=getImage.php?PROD_ID=$var1>"); ?></td

Then I have a separate php file called getImage.php

<?php //getImage.php
include("Connections/testingDB.php");
$PROD_ID = $_GET('PROD_ID');

//echo $PROD_ID;
if($PROD_ID){
$connID = mysql_select_db($database_testingDB, $testingDB);
$result = @mysql_query(
"SELECT IMAGE_THUMB FROM PRODUCT WHERE PROD_ID = $PROD_ID");
if(!$result) exit;
$row = @mysql_result($result, 0, "IMAGE_THUMB");
if(!$row) exit;
header("Content Type: jpeg");
echo $row;
};
?>

When it runs I get the webpage fine, but no images, just image place holders.

Any ideas would be greatly appreicated.
Thank you,
Chris

Reply With Quote
  #2 (permalink)  
Old October 5th, 2004, 03:52 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you checked if you are using absolute or relative folder locations?

Michael.
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
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 values in dropdown list from mysql db scoobie Beginning PHP 3 January 25th, 2005 12:09 PM
Displaying images stored in a DB on a Web Form Trevor Miles ASP.NET 1.0 and 1.1 Basics 0 January 7th, 2005 04:14 AM



All times are GMT -4. The time now is 06:49 AM.


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