Hi,
After trying the header thing which looks like this
[<?php
if(isset($GET['id']))
{
$id=$GET['id'];
$connection = mysql_connect('localhost', 'root', 'passwordl');
$dbselect = mysql_select_db('images');
$query = "select bin_data, filetype from binary_data where id=$id";
$result = mysql_query($query);
$data = mysql_result($result, 0, "bin_data");
$type = mysql_result($result, 0, "filetype");
header("content-type: $type");
echo $data;
}
?>
]
However if i use the same as a module in this script....it displays junk... Crying or Very sad
[function showItems($subcatid)
{
if (!$subcatid || $subcatid=='')
return false;
$query = "select * from items where subcatid = '$subcatid'";
$result = mysql_query($query) or die('Error, query failed');
//$row = mysql_fetch_array($result);
$connection = mysql_connect('localhost', 'root', 'password');
$dbselect = mysql_select_db('images');
$query = "select bin_data, filetype from binary_data where id=8";
$result = mysql_query($query);
$data = mysql_result($result, 0, "bin_data");
$type = mysql_result($result, 0, "filetype");
//header("content-type: $type");
//echo $data;
?>
<table border="0" cellspacing="1" cellpadding="1">
<?
while ($row = mysql_fetch_array($result))
{
extract($row)
?>
<tr>
<td width="100" height="120" align="center"><?php header("content-type: $type"); echo $data;
?>
<br><?php echo $row[1]; ?></td>
<td width="430"><?php echo $row[4]; ?><br>$<?php echo $row[2]; ?></td>
</tr>
<?
}
?>
</table>
<?
}]
I wonder what am i doing wrong.....any help will be a great favor....
thanks
dynamic desi