ITPub博客

首页 > 数据库 > MySQL > mysql随机查询代码

mysql随机查询代码

原创 MySQL 作者:jyb2014 时间:2014-10-16 16:36:51 0 删除 编辑
mysql随机查询代码
$r = mysql_query('select count(*) from user');
$d = mysql_fetch_row($r);
$rand = mt_rand(0,$d[0]-1);
$r = mysql_query('select username from user limit $rand,1');

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29753604/viewspace-1300893/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-07-15

  • 博文量
    101
  • 访问量
    196519