1.11M Members

sql query get random data

 
0
 

i have this query:

$item_query = mysql_query("SELECT * FROM item");

this will always get the data from 1st row to bottom row.

how can i get random data?

SELECT * FROM item  ORDER BY RAND()
or
SELECT * FROM item ORDER BY NEWID()

i want the best way to get random data.

 
1
 
Question Answered as of 1 Year Ago by pritaeas
Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article