Question: 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>';
}

```

Answer: 
Strip the double quotes after img src because you have already used a single quote before and it is being taken a string so remove double quotes
Ok thanks. I could solve the problem. I just changed the echo line as following

```
 echo "<tr><td>".'<img src="data:image/jpeg;base64,'.base64_encode($photo).'" alt="photo">'."</td><td>".$name."</td><td>".$email."</td></tr>";

```