i was using order by rand() to generate random rows from database without any issue but i reaalised that as the database size increase this rand() causes heavy load on serve
A possible solution is to use limit:
$id23=rand(1,$numberOfRows); SELECT items FROM tablea where status='0' LIMIT $id23 1
This wont produce any missed rows (but as hek2mgl mentioned) requires knowing the number of rows in the select.