get a rand record from DB.Table

{Code}

select * from img_lib where id >(select floor(max(id)*rand()) from img_lib) limit 0, 1