par
donatello » 18 nov. 2005, 15:44
pour éviter de se perdre, je récapitule ma question:
Pourquoi en faisant ceci
$requete = "SELECT DISTINCT ID FROM occasions ORDER BY RAND() LIMIT 4";
$result= mysql_query($requete) or die (mysql_error() . mysql_errno() );
while ($total = mysql_fetch_array($result)) {
//création tableau sélection dans la session
$_SESSION['selection0'] = $total[0];
$_SESSION['selection1'] = $total[1] ;
$_SESSION['selection2'] = $total[2] ;
$_SESSION['selection3'] = $total[3] ;
}
on obtient count($total)=1, mais en faisant ceci
$requete = "SELECT DISTINCT ID FROM occasions ORDER BY RAND() LIMIT 4";
$result= mysql_query($requete) or die (mysql_error() . mysql_errno() );
while ($total = mysql_fetch_array($result)) {
//création tableau sélection dans la session
echo $total[0];
echo $total[1] ;
echo $total[2] ;
echo $total[3] ;
}
on obtient count($total)=4