0 order by rand()"; $result=mysql_query($sql); while ($data=mysql_fetch_row($result)) { $sql2="select A.titel, A.safe, A.url, B.meta from site as A left join detail as B on A.id=B.id where A.status>0 and A.cat=$data[0] order by rand() limit 1"; $result2=mysql_query($sql2); while ($data2=mysql_fetch_row($result2)) { echo "
"; echo "\"$data2[2]\""; echo "

$data2[0]

"; echo "
$data2[3]
"; echo "website: $data2[2] ($data[1])"; echo "
\n"; } mysql_free_result($result2); } mysql_free_result($result); ?>