如何搜索结果记录分页

时间:2017-01-21 14:59:52

标签: php search paging

此代码适用于使用 POST方法进行搜索,如何分页搜索结果?

我附上了图片。使用此字段进行第一次图像搜索:

First image searching with this field

搜索我想要分页的结果:

Searching result in which  want paging

    

<? php
include('connection.php');
    if (isset($_POST['search'])) {


        $fields = array('EJAMAATID', 'GNAME', 'MOBNO', 'EMAILID', 'DNNO', 'GCNTRYID', 'PINCODE', 'GCITYID', 'DNTYPE');`search field`

        $conditions = array();

        foreach($fields as $field) {

            if (isset($_POST[$field]) && $_POST[$field] != '') {

                $conditions[] = "`$field` LIKE '%".mysql_real_escape_string($_POST[$field]). "%'";`condition`
            }
        }


        $query = "SELECT * FROM donation ";   
        $orderby = "ORDER BY DNDATE desc";
        $datebetween = "AND DNDATE >='$start' AND DNDATE<='$end'";

        if (count($conditions) > 0) {

$yakin5 = implode(' AND ', $conditions);
$query. = "WHERE ".$yakin5.$datebetween.$orderby; 
        }

    }
    $jo = (isset($query)) ? $query : '';

    $don4 = mysql_query($jo);
    while ($roww = mysql_fetch_array($don4)) {

        }
    ?>

0 个答案:

没有答案