我正在运行一条while
语句以在我的数据库中显示艺术家的图像。目前,它多次而不是一次显示相同的图像。我怎样才能使图像显示一次而不是多次?
这是我的代码:
<?
while ($feed = mysql_fetch_object($query)) { ?>
<?
if ($count == '4') {
$count = 0; ?>
<div class="blog_item">
<div class="preview_wrapper">
<div class="featured_image_full">
<?
$query1 = mysql_query("SELECT * FROM `Artists` WHERE `Genre1` = '$usr->Genre1' OR `Genre2` = '$usr->Genre1' OR `Genre3` = '$usr->Genre1' OR `Genre1` = '$usr->Genre2' OR `Genre2` = '$usr->Genre2' OR `Genre3` = '$usr->Genre2' OR `Genre1` = '$usr->Genre3' OR `Genre2` = '$usr->Genre3' OR `Genre3` = '$usr->Genre3' ORDER BY RAND() LIMIT 0,1");
while ($art = mysql_fetch_object($query1)) { ?>
<img src="<? echo $art->image; ?>">
<? } ?>