0

当我必须搜索任何东西时,它会给我正确的 sesrch,但是当我单击第 2 页导航以显示更多记录时,它不会显示正确的结果。简而言之,我对其应用了分页,但在单击第二页后,搜索查询不仅仅运行简单的查询运行。请告诉我是哪个问题?

    <form method="post" action=""><input type='textbox' name="searchfield" id='searchfield' $value style='height:25px; width:275px; border-radius:5px 5px 5px 5px; margin-top:50px; margin-bottom:50px;' />    <input type="submit" id='GetBtn' name="GetBtn" class='GetBtn' value="Search"></form>

    <?php 

    if(isset($_GET['GetBtn'])){
         $match = str_replace('-',' ',slugify($_POST['searchfield']));

       $query_pag_data = "SELECT * FROM `imported_deals` WHERE MATCH ( `Name`, `Category` )
AGAINST ('$match' IN BOOLEAN MODE)";

    }
     else{   
    $query_pag_data = "SELECT * FROM `imported_deals` LIMIT $per_page ( `Name`, `Category` ) 
AGAINST ('$match' IN BOOLEAN MODE)";
     }

     $PAGING        =   new PAGING($query_pag_data,10);
    $query          =   $PAGING->sql;
    $res                =   mysql_query($query);
    if(!$res) die(mysql_error());


    if($show['subcat_name'] != '')
        {
             echo($PAGING->show_paging("http://yespricer.com/","deals/".slugify($fullname)."/".slugify($show['subcat_name'])."/page")); 
        }
        else
        {
             echo($PAGING->show_paging("http://yespricer.com/","deals/".slugify($fullname)."/page")); 
        }

    ?>
4

1 回答 1

0

无论您从帖子中获得什么值,都将它们存储在表单中的隐藏字段中,并将它们作为获取/发布数据推送到第二页。

于 2012-11-08T05:18:13.843 回答