Utkarsh Sharma Utkarsh Sharma - 3 months ago 15
MySQL Question

how to fetch data from database randomly?

Right now i am just using simple query to fetch data but it fetching like the way i store in database linewise . But i want to fetch randomly but how ??

here is my query

Select * from FOOD where food_price <= ?

Answer

Try This...

Select * from FOOD where food_price <= ? ORDER BY RAND()
Comments