Теперь нужно три картинки выводить...три юзера. Как в этом случае сделать? так while ((($rnd3=rand(1, $db1n))==$rnd)==$rnd2); не работает(
<?php
mysql_connect($hostddd, $userdbddd, $passdbddd);
mysql_select_db($databaseddd);
$db1n = mysql_num_rows(mysql_query("SELECT * FROM writers"));
$rnd = rand(1, $db1n);
$db1 = mysql_fetch_assoc(mysql_query("SELECT * FROM writers WHERE id='".$rnd."'"));
$wri = "<a href='index.php?option=com_content&view=article&id=48#".$db1['id']."'>
<img src='http://localhost/writers/".$db1['photo']."'></img></a>
<br>
<b>".$db1['name']."</b><br><span style='font-size: 11px'>Age: ".$db1['age']."</span>
<br><span style='font-size: 11px'>Country of Residence: ".$db1['country']."</span>
<br><span style='font-size: 11px'>Degree: ".$db1['degree']."</span><br><br>";
while (($rnd2=rand(1, $db1n))==$rnd);
$db2 = mysql_fetch_assoc(mysql_query("SELECT * FROM writers WHERE id='".$rnd2."'"));
$wri2 = "<a href='index.php?option=com_content&view=article&id=48#".$db2['id']."'>
<img src='http://localhost/writers/".$db2['photo']."'></img></a>
<br>
<b>".$db2['name']."</b><br><span style='font-size: 11px'>Age: ".$db2['age']."</span>
<br><span style='font-size: 11px'>Country of Residence: ".$db2['country']."</span>
<br><span style='font-size: 11px'>Degree: ".$db2['degree']."</span><br><br>";
echo "<br>".$wri.$wri2;
?>