{% else-1 %}
Victor * Верифицирован 41.36
(26 апр 2017, 13:10) (2/0) [2]
<?

$cats = mysql_query("SELECT id,name from `cats` order by `id` desc " );

while($cat = mysql_fetch_array($cats)) {
$file = mysql_query("SELECT id,name FROM `files` where `id_cat` = '".$cat['id']."' ORDER BY rand() DESC LIMIT 6 " );
while($f= mysql_fetch_array($file)) {
echo $f['name'];
}

}

*
  • 1 из 1