duanliaoyu8419 2016-07-02 19:33
浏览 21

使用php和css对菜单进行分页

I have seen a lot of answers which cant really answer to what i need.

Let´s suppose that i have a database with commentaries of users. I wanna limit the commentaries to 10 per page [I know how to make the sql query and limit the results but i still can't figure out how to build the code] The problem is that i dont know how to make the pagination as it can be seen in the next image:

http://i.stack.imgur.com/J7sRt.png Thanks.

This is what i have written:

require("con.php");

$Mystring="SELECT commentaries FROM mydb WHERE 1 LIMIT 25";
$runQuery=mysqli_query($link,$Mystring);
$Myrow=mysqli_num_rows($runQuery);
$commentary=$Myrow['commentaries'];

if($Myrow>=1){ //If there is at least 1 commentary it will be displayed
    echo $commentary;
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号