Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php MySql分页&引用;“显示结果集”;“的;总发现量“;帮助_Php_Sql_Mysql_Html_Database - Fatal编程技术网

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)