Re: Select random sempre differenti
Sorry mi partito il messaggio
comunque riprendo..
$my_array = array();
$stringa = '';
$my_array = array_filter($arrayAudioId);
$x = 0;
$item = count($my_array);
if (!empty($my_array)) {
foreach ($my_array as $v){
$listaAudioId .= $v;
if (++$t != $item) $stringa .= ',';
}
}
$sql2 = $stringa ? "WHERE id NOT IN ($stringa)" : "";
$sql = "SELECT * FROM your_table $sql2 LIMIT 5 ORDER BY RAND()";
Così dovrebbe funzionare correttamente inserito in un ciclo
Subject
Views
Written By
Posted
1918
June 25, 2015 03:56AM
1120
July 16, 2015 03:49PM
Re: Select random sempre differenti
1075
July 16, 2015 03:57PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.