Please help. Im trying to display the image of each user using their student ID BUT it displays unknown characters as image on my page as below
%�S$P��H�~Q��-�}Y>ZTW�)�,G����g�~)�1WN�{�,��!���^j-����9�4���K�����
$sql_up="SELECT content FROM sp_uploads WHERE s_id= 'RC49557'";
$result_set=mysql_query($sql_up);
while($row_up = mysql_fetch_array($result_set))
 {
    $pp = $row_up['content'];
 } 
    echo "<td>  
 <img style=\"float:right; margin:5px; width:150px; height:150px; padding:10px; \" 
 src=\"  data:image/jpg;charset=utf8;base64,<?php echo $pp ?>   \"  /> </td>"; 
                This will do. You don't need to open PHP tags inside PHP tags.
$sql_up="SELECT content FROM sp_uploads WHERE s_id= 'RC49557'";
$result_set=mysql_query($sql_up);
while($row_up = mysql_fetch_array($result_set))
 {
    $pp = $row_up['content'];
 } 
 echo "<td>  
 <img style='float:right; margin:5px; width:150px; height:150px; padding:10px;' 
 src='data:image/jpg;charset=utf8;base64, $pp' /> </td>"; 
I'm assuming the img data is correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With