$count = 0;
$Q = "SELECT (SELECT image_short_name FROM user WHERE username = '$user') as `image_short_name`"
.",`image_id`,`image`"
." FROM `image`"
." ORDER BY RAND()"
." LIMIT 30";
$R = mysql_query($Q);
echo "
<div id ='bg'>
<div id='context'>
<table>
<tr>
";
while($row = mysql_fetch_assoc($R))
{
echo "<td>";
$image_db = $row['image'];
$src = "data:image/gif;base64," . $image_db;
echo" <img src=\"$src\" height='20%' width='20%' class='image' />";
echo "</td>";
$count++;
if($count == 5) //5 rows
{
echo "</tr><tr>"; // Start a new row at 6 cells
$count = 0;
}
}
echo "
</tr>
</table>
</div>
</div>
";
1st problem
i am having problem with my table. its printing all image with different size.
2nd problem
i want to print images name too. and iam not sure how to do that.