在php中 重置资源行数 - 疯子的紫梦's 学习窝
PHP生成图表pChart
empty,isset,is_null你都搞清除了么?[转载]

在php中 重置资源行数

疯子的紫梦 posted @ 2010年1月27日 05:29 in php , 1302 阅读

今天在给一个群里面的朋友解决的问题的时候,遇到了一个问题

就是双循环数据资源,代码如下:

 

$sql1=mysql_query("select * from phome_enewsmember order by userid desc");
    $sql2=mysql_query("select * from phome_enewsmemberadd order by userid desc");
while($row1=mysql_fetch_assoc($sql1)){
    while($row2=mysql_fetch_assoc($sql2)){

        echo $row2['userid'].'<br />';
    }
   
    echo $row1['userid'].'<br />';
}

刚开始想,应该是循环12次的,两个表各有数据3条,3*3+3

但是运行下来,只有6次,内循环少循环了两次.

刚开始,我以为是$row2没有重置,用了reset($row2).结果不行

后来,在手册里面看到,是需要用mysql_data_seek($sql2,0);   重置一下资源的.解决..

Avatar_small
Madrasah Board Resul 说:
2022年9月03日 11:01

Government of the People’s Republic of Bangladesh, Directorate of Primary Education (DPE), is going to announce PSC Result 2022 in student wide on 30th December 2022 for all divisional Grade 5 exam result with Ebtedayee Result 2022 for annual final terminal examinations, The Primary School Certificate Examination Result 2022 will be announced for both of General and Madhrsah students in division wise to all education board known as Prathomik Somaponi Result 2022. Madrasah Board Result The DPE has successfully conducted the class 5th grade PSC and Ebtedayee Examination tests from 17th to 24th November 2022 under all education boards of Dhaka, Chittagong, Comilla, Rajshahi, Sylhet, Barisal, Jessore, Dinajpur and Madrasah Board, and the DPE Grade-5 exams are successfully conducted at all 7,194 centers across the country.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter