<tr> <?php $rer=mysql_query(“select EI_EmployeeId,EI_EmployeeName from employeeinfo order by EI_EmployeeId asc limit 0,10″); while($inf=mysql_fetch_array($rer)){ ?> <td> <input type=”checkbox” name=”menuemployname” id=”menuemployname” value=”<?php echo $inf['EI_EmployeeName']?>”/><?php echo $inf['EI_EmployeeName']?> </td> <?php }?> </tr>
<?php $rer=mysql_query(“select EI_EmployeeId,EI_EmployeeName from employeeinfo order by EI_EmployeeId asc”); $num=mysql_num_rows($rer); $i=0;$j=10; $count=ceil($num/$j); for($k=0;$k<$count;$k++){ $i=$i+$j; ?> <tr> <?php $rer=mysql_query(“select EI_EmployeeId,EI_EmployeeName from employeeinfo order by EI_EmployeeId asc limit $i,$j”); while($inf=mysql_fetch_array($rer)){ ?> <td> <input type=”checkbox” name=”menuemployname” id=”menuemployname” value=”<?php echo $inf['EI_EmployeeName']?>”/><?php echo $inf['EI_EmployeeName']?> </td> <?php }?> </tr> <?php }?>
当然还有更直接的方法,就是多次循环第一次循环,只需要改动Limit的第一个参数即可。希望对于初学者phper有所帮助。