Php MySql分页&引用;“显示结果集”;“的;总发现量“;帮助
我需要一个在我的分类广告网站上显示结果的公式 我现在已经完成了记录分页,但显示结果的公式仍然存在 我想要这样:Php MySql分页&引用;“显示结果集”;“的;总发现量“;帮助,php,sql,mysql,html,database,Php,Sql,Mysql,Html,Database,我需要一个在我的分类广告网站上显示结果的公式 我现在已经完成了记录分页,但显示结果的公式仍然存在 我想要这样: Showing 1-50 of 123 found. 那么这个公式是什么呢 我有这些变量,应该足够了,我想: $results_per_page = 50; //results per page $page = 1; //current page Also a variable called $num_total contains the total nr of hi
Showing 1-50 of 123 found.
那么这个公式是什么呢
我有这些变量,应该足够了,我想:
$results_per_page = 50; //results per page
$page = 1; //current page
Also a variable called $num_total contains the total nr of hits, in this case 123.
谢谢这是你想要的吗
<?php
$page = 1;
$results_per_page = 50;
$num_total = 123;
echo 'Showing ' . ((($page - 1) * $results_per_page) + 1)
. '-' . min($num_total, ($page * $results_per_page))
. ' of ' . $num_total . ' found.';
?>
这就是你想要的吗
<?php
$page = 1;
$results_per_page = 50;
$num_total = 123;
echo 'Showing ' . ((($page - 1) * $results_per_page) + 1)
. '-' . min($num_total, ($page * $results_per_page))
. ' of ' . $num_total . ' found.';
?>
@Camran:你想让我写if($num\u total>0)
?@Camran:你想让我写if($num\u total>0)
?