Hi,
I have this code written to return values from my database. The database contains 7 fields, "ID, Category, Description, BIN_DATA, Thumb, Filename, Filesize and Filetype". I query the database to return me ID, Category, Description, Filesize and Filetype and this works fine, displaying the text results in the correct HTML table colums, like I specify. However, I would like to include a small thumbnail at the end of the table, to show a miniture representation of the data before people click the link. I have tried using the same method as above, but I keep getting the binary data returned to me - a load of text and numbers, when I obviously want the image! The code is below, without my attempted thumbnail code in. If anyone has any ideas I would be most grateful!
<?php
$db = mysql_connect("localhost", "dbase", "pass");
mysql_select_db("dbase",$db);
$sql="SELECT * FROM main";
$result=mysql_query($sql,$db);
$num = mysql_num_rows($result);
$cur = 1;
echo '<table width="80%" border="0" cellspacing="2" cellpadding="1" class="content">
<tr>
<td nowrap><font="arial" size="2"><b>id</b></font></td>
<td nowrap><font="arial" size="2"><b>Category</b></font></td>
<td nowrap><font="arial" size="2"><b>Description</b></font></td>
<td nowrap><font="arial" size="2"><b>File Size</b></font></td>
<td nowrap><font="arial" size="2"><b>File Type</b></font></td>
<td nowrap><font="arial" size="2"><b>Thumbnail</b></font></td>
</tr>';
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$id = $row["id"];
$cat = $row["category"];
$desc = $row["description"];
$size = $row["filesize"];
$type = $row["filetype"];
$thumb = $row["thumb"];
echo "<tr><td nowrap>$id</td><td nowrap>$cat</td><td nowrap><a href=\"getdata.php3?id=$id\">$desc</a</td><td nowrap>$size</td><td nowrap>$type</td><td nowrap>$thumbdata</td></tr>";
$cur++;
}
?>