I need help to write user image and username from sql to html I tried this codes;
$query = mysql_query("SELECT * FROM tbl_images WHERE id<'".$id."'");
$row = mysql_fetch_array($query) or die();
$query = mysql_query("SELECT username FROM Users WHERE id<'".$id."'");
echo '<table>';
while($rowtwo = mysql_fetch_array($query)){
echo '<tr>
<td><img height="115" width="115" src="data:image/jpeg;base64,' . base64_encode( $row['image'] ) . '"/></td>
<td><font size="2" face="Lucida Sans Unicode" color=#EBEBEB>' .$rowtwo['username'].'</td>
</tr>';}
echo '</table>';
U should try a join query for username and image, so that u only have to use one query and one mysql_fetch_array()
try it like this:
but is your base64_encode correct? I think it should be decode???