11智能在线
新记
php读取mysql数据库表的前20条记录,然后分两行显示,每行10条记录,怎么编?
有实例最好,多谢!
举报该文章
相关建议 推荐于2016-07-08
$result = mysql_query('select * from mytable limit 0, 20');
$i = 0;
while ($rs = mysql_fetch_array($result))
{
echo $rs['myfield'].' ';
$i++;
if ($i == 10)
{
echo '<br />';
}
}
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/247v7824v.html
其他看法
无其他回答
相似回答
大家正在搜
相关问题
PHP中取出MYSQL中两行数据,要特定行数据输出到做计算,...
php mysql只查询前10条数据
php从mysql数据库中按最新的10条信息中随机抽取2条显...
php,怎么输出mysql表中每组10条数据?
php获取MySQL的最新几行数据
PHP如何实现按格式输出MYSQL数据库中的前几条记录
php读取mysql数据库随机显示指定数量的记录
PHP读取MYSQL数据库读取出来的数据怎么控制一行显示一条...