后端开发|php教程
nbsp,lim,result,mysql,myrow
后端开发-php教程
请教高人看看这段代码那里错了,运行结果死循环。
$result=mysql_query(“SELECT * FROM st where cid = 1”);
$max_num=mysql_num_rows($result);//取得数据库的记录数
srand((double)microtime()*10000000); //生成随机数种子。
xutil源码下载,ubuntu下破解网站,tomcat连接断链503,爬虫的音调,零基础php模板,seo的名词解释seo顾问lzw
$se_pos=rand(0, $max_num-1); //从0到最大记录数取随机数
$length=1; //设定共取多少条记录
//下面是取出指定数目的记录。
$result_lim=mysql_query(“select * from st where cid = 1 limit $se_pos,$length”);
$myrow_lim=mysql_fetch_array($result_lim);
ybi金融互助源码,ubuntu卡死进入tty,tomcat上运行网页网址,小圆虫爬虫,php简易折线图,前线seolzw
$se_pos1=rand(0, $max_num-1);
$result_lim1=mysql_query(“select * from st where cid = 1 limit $se_pos1,$length”);
$myrow_lim1=mysql_fetch_array($result_lim1);
如何下载tomcat源码,宏碁平板安装Ubuntu,tomcat 部署安装包,爬虫宠物社区,北京php分销平台定制,吴豪 seolzw
while($myrow_lim=$myrow_lim1) {
$se_pos1=rand(0, $max_num-1);
$result_lim1=mysql_query(“select * from st where cid = 1 limit $se_pos1,$length”);
$myrow_lim1=mysql_fetch_array($result_lim1);
}
——解决思路———————-
$result_lim1=mysql_query(“select * from st where cid = 1 limit $se_pos1,$length”); //除非出错,总是返回至少包含一条记录的结果集
$myrow_lim1=mysql_fetch_array($result_lim1);//所以 $myrow_lim1 总是为非空的数组
既然 $myrow_lim1 非空,那么这个循环怎么会终止呢?
while($myrow_lim=$myrow_lim1) {