ragazzi ci sono riuscito , è utile la funzione ordina in maniera casuale un array
Codice PHP:
<table border="0" width="600" cellpadding="0" cellspacing="0">
<tr>
<td>
<?php
$verticali = 0 ;
$orizzontali = 0 ;
while ($verticali < 3 ){
$sql_aut = "SELECT * FROM fotopubbliche WHERE activa ='1' order by rand() limit 1";
$resultaut = mysql_query($sql_aut, $db) or die("Errore nella query:".mysql_error());
while ($row = mysql_fetch_array($resultaut)){
$nomeattuale = $row["idcategoria"];
$links = "public2/$nomeattuale/Thumbnails/$row[nomefoto]" ;
$sizearray = array();
$size = getimagesize($links);
list($width, $height) = $size;
$sizearray[$links[$i]] = array("width" => $width, "height" => $height);
if ($width < $height){
$verti[$verticali]= "[url='mygallery.php?carte=$Nomecartella&attuale=$nomeattuale&datacc=$datac'][img]/public2/".$nomeattuale."/Thumbnails/".$row[nomefoto]."[/img][/url]";
$verticali=$verticali +1 ;
}
}
}
while ($orizzontali < 3 ){
$sql_aut = "SELECT * FROM fotopubbliche WHERE activa ='1' order by rand() limit 1";
$resultaut = mysql_query($sql_aut, $db) or die("Errore nella query:".mysql_error());
while ($row = mysql_fetch_array($resultaut)){
$nomeattuale = $row["idcategoria"];
$links = "public2/$nomeattuale/Thumbnails/$row[nomefoto]" ;
$sizearray = array();
$size = getimagesize($links);
list($width, $height) = $size;
$sizearray[$links[$i]] = array("width" => $width, "height" => $height);
if ($width > $height){
$ori[$orizzontali]= "[url='mygallery.php?carte=$Nomecartella&attuale=$nomeattuale&datacc=$datac'][img]/public2/".$nomeattuale."/Thumbnails/".$row[nomefoto]."[/img][/url]";
$orizzontali=$orizzontali +1 ;
}
}
}
$stringa = array($ori[0],$ori[1],$ori[2],$verti[0],$verti[1] ,$verti[2]);
shuffle($stringa);
while (list(, $numero) = each($stringa)) {
echo "$numero";
}
?>
</td>
</tr>
</table>
grazie spero che a qualcuno serva