任何人都知道如何使用RAND()php msql
在限制ID之间使用Random wallpaperid我使用它,但它的RAND()整个数据库
$sql_wallpaper = "SELECT * FROM wallpaper WHERE RAND()>0.9 ORDER BY RAND() LIMIT 0,5";
$res_wallpaper = mysql_query($sql_wallpaper);
请回复
答案 0 :(得分:2)
你是说这个吗?
$sql_wallpaper = "SELECT * FROM wallpaper WHERE id>Min AND id<Max ORDER BY RAND() LIMIT 1";
$res_wallpaper = mysql_query($sql_wallpaper);