Php 从id不规则的表查询的分页

Php 从id不规则的表查询的分页,php,mysql,Php,Mysql,我的桌子是这样的: id code name 110 qqwe abhabah 111 qqwe fgfgfgf 115 dsfsd sdsdfsdf 我想对查询进行分页从'table'中选择名称,其中code='qqwe' 我该怎么做 使用限制 将从结果0开始获得前10个结果 SELECT name FROM 'table' WHERE code='qqwe' LI

我的桌子是这样的:

id         code         name
110       qqwe          abhabah
111       qqwe           fgfgfgf
115        dsfsd          sdsdfsdf
我想对查询进行分页
从'table'中选择名称,其中code='qqwe'

我该怎么做

使用
限制

将从结果0开始获得前10个结果

SELECT name FROM 'table' WHERE code='qqwe' LIMIT 10 10
将获得接下来的10个结果等

从“表”中选择名称,其中code='qqwe'LIMIT$start$LIMIT

鉴于

<?php
            $num = 1;
            for ($i = 0; $i < $size; $i = $i + $limit) {
                if ($i != $start) {
    ?>
                    <a href='<?php echo $category[0]['link'] . ".html" ?>?page=<?php echo $i; ?>'>
       <?php echo $num ?>
                 </a> 
<?php
                } else {
                    echo "<a href='' class='selbull'>$num</a>";
                }
                $num++;
            }
       ?>

不管您的查询是什么样的。分页逻辑保持不变。这个网站上有很多例子,所以投票决定关闭。
 $start = $_GET['page'];
    $s = ($start - 0);
    $limit = 6; // No of records to be shown per page.
    $back = $start - $limit;
    $next = $start + $limit;
<?php
            $num = 1;
            for ($i = 0; $i < $size; $i = $i + $limit) {
                if ($i != $start) {
    ?>
                    <a href='<?php echo $category[0]['link'] . ".html" ?>?page=<?php echo $i; ?>'>
       <?php echo $num ?>
                 </a> 
<?php
                } else {
                    echo "<a href='' class='selbull'>$num</a>";
                }
                $num++;
            }
       ?>