MySQL Forums
Forum List  »  Italian

Re: Select random sempre differenti
Posted by: Marika Freguglia
Date: July 16, 2015 03:49PM

Ciao,
a mio avviso non risolvi solo con una query, devi implementare una porzione di codice, php ad esempio.

$listaAudioId = '';
$arrayAudioId = array_filter($arrayAudioId);
$t = 0;
$countAudioId = count($arrayAudioId);
if (!empty($arrayAudioId)) {
foreach ($arrayAudioId as $v){
$listaAudioId .= $v;
if (++$t != $countAudioId) $listaAudioId .= ',';
}
}


$myarray = array();


$myarray = array_filter($myarray);

if (!empty($errors)) {

}
$sql = "SELECT * FROM your_table $sql2 LIMIT 5 ORDER BY RAND()";

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Select random sempre differenti
1118
July 16, 2015 03:49PM


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.