$buscatotal = mysql_query("SELECT * FROM $tab_walls"); $total = mysql_num_rows($buscatotal); if($total>0) { function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } srand(make_seed()); $randval = rand(); for ($i = 0; $i < $nwalls; $i++) { $wall[$i] = mt_rand(1,$total); $id_busca = $wall[$i]; $buscawall = mysql_query("SELECT * FROM $tab_walls WHERE id='$id_busca'") or die("ERRO AO SELECIONAR"); $colunas = "2"; if (($i%$colunas)==0) { echo "</tr>"; echo "<tr>"; } $dados = mysql_fetch_array($buscawall); $id = $dados["id"]; $thumb = $dados["thumb"]; echo "<td width=50% align=center><a href='javascript:;' Onclick=\"javascript:abre('walls.php?ID=$id','640','480','0')\"><img border=0 src='$thumb' width=120 height=90></a></td>"; } echo "</table> </center></div> </td></tr> </table> </center></div>"; } else { echo "Nenhum registro encontrado"; } }
dessa veiz postei o código completo.. heheeh.... bom.... ele tá randomizando certinho.. porém tem vez ki ele repete o mesmo wall.. fika duas vezes o mesmo... isso tem como corrigir?