image not rending from BLOB (garbage and windings appear)

Hi,

I was wondering if anyone could identify what is wrong with my following php and why i am not being able to see the images i stored on my mysql database. Any help would be much appreciated.

Thanks

[php]

<?php require_once "dbc.php"; $query = "SELECT * from cars"; $result = mysql_query ($query); $rCount = mysql_num_rows($result); $aresult = array(); $aresult = mysql_fetch_array($result); ?> <?php while($row = mysql_fetch_array($result)){ $CID = $row ["id"]; echo '
'; echo '
'.$row ["Car_Name"]; echo '
Product Number: '.$CID; echo '
Price: '.$row ["Price"]; echo '

'; ''; } ?>

[/php]

If you require more code please let me know

Thanks

Hi,

I managed to get this working but the first image id is not loading?? would anyone know of why this is not working??

This is the following code:

[php]
require “dbc.php”;

$query = “SELECT * from cars”;

$result = mysql_query ($query);

$rCount = mysql_num_rows($result);

$aresult = array();

$aresult = mysql_fetch_array($result);

while($row = mysql_fetch_array($result)){

$CID = $row [“id”];

echo’


<a href=“carinformation.php?id=’.$row[“id”]. '”><img width=“500px” height=“200px” src=“data:image/jpeg;base64,’. base64_encode($row[“picture”]). '” />’;
echo ‘
’.$row [“Car_Name”];
echo '
Product Number: '.$CID;
echo ‘
Price: &pound’.$row [“Price”];
echo ‘

’;
‘’;
}

[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service