Kal
10-30-2006, 01:24 PM
Hi
i have a script which will upload an image into my mysql database and store it in the BLOB type, however i am having trouble trying to display this image when i call using a query.
any help would be great.
<?php
$id=$_GET['id'];
require('database.php');
$query = "select
id,
title,
description,
DATE_FORMAT(date_posted,'%d/%m/%Y') as date_posted,
image
from orb_orb.press_release
where id = '$id'";
$result = mysql_query ($query) or die (mysql_error());
if (mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td><strong><?php print $row['title'];?></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<table border="0" cellpadding="0" cellspacing="0" align="right">
<tr>
<td> </td>
<td valign="top"><img src="/Press Release Layout/Press_Images/<?php print $row['image']; ?>" align="right"></td>
</tr>
</table>
<p><?php print nl2br ($row['description']);?></p>
<tr>
<td> </td>
</tr>
<tr>
<td><p><b>Date Posted:   </b><?php print nl2br ($row['date_posted']);}}?></p></td>
</tr>
<tr>
<td> 
</tr>
</table>
i have a script which will upload an image into my mysql database and store it in the BLOB type, however i am having trouble trying to display this image when i call using a query.
any help would be great.
<?php
$id=$_GET['id'];
require('database.php');
$query = "select
id,
title,
description,
DATE_FORMAT(date_posted,'%d/%m/%Y') as date_posted,
image
from orb_orb.press_release
where id = '$id'";
$result = mysql_query ($query) or die (mysql_error());
if (mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
?>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td><strong><?php print $row['title'];?></strong></td>
</tr>
<tr>
<td> </td>
</tr>
<table border="0" cellpadding="0" cellspacing="0" align="right">
<tr>
<td> </td>
<td valign="top"><img src="/Press Release Layout/Press_Images/<?php print $row['image']; ?>" align="right"></td>
</tr>
</table>
<p><?php print nl2br ($row['description']);?></p>
<tr>
<td> </td>
</tr>
<tr>
<td><p><b>Date Posted:   </b><?php print nl2br ($row['date_posted']);}}?></p></td>
</tr>
<tr>
<td> 
</tr>
</table>