air jordan xx8 ajax实现无刷新分页php
程序员文章站
2022-04-05 18:47:04
...
复制代码 代码如下:
投票结果
复制代码 代码如下:
$con .=
PAGE;
echo $con;
?>
复制代码 代码如下:
$link = mysql_connect('localhost', 'root', '') or die(mysql_error());
mysql_select_db('vote', $link) or die(mysql_error());
mysql_query("set names utf8");
$num = 3;
$url = "page.php";
$con = "
- ";
- $content[0]: $content[1] ";
$page = (isset($_REQUEST['page'])) ? $_REQUEST['page'] : 1;
$offset = ($page - 1) * $num;
$result = mysql_query("SELECT COUNT(*) FROM client");
$total = mysql_fetch_row($result);
$total = $total[0];
$pagenum = ceil($total / $num);
$page = min($pagenum, $page); //获得首页
$prepg = $page - 1; //上一页
if ($prepg $prepg = 1;
$nextpg = ($page == $pagenum ? 1 : $page + 1); //下一页
//如果只有一页则跳出函数:
if ($pagenum return false;
$sql = "SELECT `name`,`content` FROM `client` LIMIT " . $offset . "," . $num;
$res = mysql_query($sql);
while ($content = mysql_fetch_row($res)) {
$con .= "
}
$con .= "
$con .=
PAGE;
echo $con;
?>
以上就介绍了air jordan xx8 ajax实现无刷新分页php,包括了air jordan xx8方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
上一篇: H5页面中尝试调起APP实例代码