1st - this code here prints random image from database. but i need help print random images but no repeating images.
2nd queestion is that how can i use this code to print image name. too.
$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);
while($row = mysql_fetch_assoc($R))
{
$image_db = $row['image'];
$src = "data:image/gif;base64," . $image_db;
echo"<img src=\"$src\" height='15%' width='15%' class='image_p' /> ";
}
hwoarang69 11 Newbie Poster
JudgeyD 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.