0

I am trying to fetch an image from database and display in my webpage through pdo,

Image is not displaying instead it appears as "lº·“w~ïFVÅà%@|vmŸú¿E8Ö®?ð²ý>ñNòTML°^¯F®Ìü9ù²÷fÕèÕÙ³îç®^éª@1 ½§~îþlY4º7ñZS,,¾³Ö9ú7“cÐ5z4v^[éÙý¹Yõú¨Ôè—fkIrÓ·knó~þRmü2¶: %@Ì®Òß ¸t¾•ÈáºG¼Ohý¤øtå’ÿêÙ·/÷G£cЖ1ñ:;¶¡œý‘º[[mÇ+-·ŸÕµÈàuæžwvÇ=¹Þì»tUÀñäÏòå챃µ8§ÙN¹uòÄx].Mr+Ñœ–­<¥©c§•éõ¼“=/‹" -

MY Code is.,

    <div class = "controlbox">

<form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "get">
<select name = "rowno" onchange = "javascript:document.forms[0].submit();">
  <option>--Select a Domain--</option>

<?php
try
{$db = new PDO('mysql:host=localhost;dbname=nativelead', 'newmellow', 'db@nativelead');}
catch( PDOException $e )
{die( $e->getMessage() );}

$sql = 'SELECT * FROM ind_register';
$result = $db->query($sql);


while ($row = mysql_fetch_object($result)) {
    echo '<img src="image.php?ind_reg_id=' . $row->ID . '">';
}





$rowarray = $result->fetchall(PDO::FETCH_ASSOC);
$rowno = 0;


foreach($rowarray as $row)
{
echo "<option value = $rowno >$row[ind_reg_focus] </option>";
$rowno++;

}
?>
</select>
</form>
</div>



<?
if ($_GET[rowno])
{
$rowno = $_GET[rowno];}
else
{$rowno = 0;}

$row = $rowarray[$rowno];
echo "<h2>$row[ind_reg_focus]</h2>";
echo "<h3>$row[ind_reg_name]</h3>";
echo "<h3>$row[ind_reg_id]</h3>";
echo "<img src="data:image/jpeg;base64,'.base64_encode($pics).'"/>";



echo "<table id='otable'>";



?>
<?
echo "</table>";
?>

How do i overcome this??

Thanks in advance.

Edited by My question

3
Contributors
4
Replies
21
Views
3 Years
Discussion Span
Last Post by My question
0

im sensing the line 53 of yours is an error

echo "<img src="data:image/jpeg;base64,'.base64_encode($pics).'"/>";

would you try to decode that part that may help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.