php - Trouble Shuffling a MYSQL Result Set -


via database returning array by:

print_r($stmt->fetchall(pdo::fetch_assoc)); 

as expected looks there. add php "shuffle" function so:

print_r(shuffle($stmt->fetchall(pdo::fetch_assoc))); 

the result "1". no shuffled array.

i wanting query result set , them output them in random order guarantee of no duplicates. in regards appreciated. thanks.

shuffle() takes reference array , return boolean, should do:

$result = $stmt->fetchall(pdo::fetch_assoc); shuffle($result); print_r($result); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -