I'm trying to get a random value from an array that is populated with data from the database. I'm selecting some products from the DB and display them on the front page, but i need to display different (random) producs everytime the page is reloaded.
$row = mysql_query("SELECT * FROM anunt WHERE lichidareStoc = 0 ORDER BY anuntID DESC") or die(mysql_error());
$row2 = mysql_fetch_assoc($row);
So, i think that $row2 is now an array, and has all the infos that i selected previously from the database. How do i select a random 'row' from that array now?
Thanks