php-sql-smarty分页 [英] php-sql-smarty pagination

查看:80
本文介绍了php-sql-smarty分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:

$gemng = $db->query("SELECT * FROM students ORDER BY student_name ASC ");
while($ftmng = $db->fetch_array($gemng))
{
    $magn[] = $ftmng;
}
$tpl->assign('mn', $magn);
$db->free_result($gemng);

我只想显示20名学生的成绩.并在页面中显示其他内容.我该怎么做...您可以修复代码并向其中添加分页代码吗?不用担心我会处理的html文件

I want to display a result with only 20 student not more than that. and display others in pages. how can I do that ... can you fix the code and add the pagination code to it ? do not worry about the html file I will take care of it

推荐答案

这是一个简单的教程进行编码.这些评论讨论了其他问题的解决方案.

Here's a simple tutorial on how to code it. The comments discuss solution to additional problems.

这篇关于php-sql-smarty分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆