samedi 27 juin 2015

Image retrieval from mysql database in php not working

I am getting an image from mysql database and trying to show it. I am using the following code. But its not working .What's the mistake i am making?

while ($row=mysql_fetch_array($result,MYSQL_ASSOC)) {
    $photo=$row['photo'];
    $name=$row['firstname'].' '.$row['lastname'];
    $email=$row['email'];
    echo "<tr><td>".'<img src="data:image/jpeg;base64,<?php echo base64_encode( $photo ); ?>" />'.'</td><td>'.$name.'</td><td>'.$email.'</td></tr>';
}

Aucun commentaire:

Enregistrer un commentaire