Search in Php+mysql station + pagination

Source: Internet
Author: User
Tags php print
Php+mysql Station Search + paging, the following is the station search part (can display), pagination is not divided, because of life forced me to learn to finish this project to others, all the template framework, the following code in Baidu know not to submit, special to help, Trouble master help younger brother
if (isset ($_post[' search ') and $_post[' search ']!=null) {
$result =mysql_query ("select * from Tb_members where shopname like '%". $_post[' Search ']. " %'");
$info =mysql_fetch_array ($result), if ($info >=1) {
while ($info =mysql_fetch_array ($result)) {?>
">
}
}else{
echo "Not what you're looking for!" ";
}
}
?>


Reply to discussion (solution)

Paging is a very basic part, I do not give a solution to the code, and find the next few years ago bought the book on the CD-ROM php+mysql page instance code, I hope you can understand the use of paging

 $totalPages) $pageNum = $totalPages;//Set start line number $startrow = ($pageNum-1) * $maxRows;//Add LIMIT clause for query statement $sql_limit = Sprint F ("%s LIMIT%d,%d", $sql, $startRow, $maxRows);//Send query statement $rs = mysql_query ($sql _limit) or Die (Mysql_error ());//From Get a row of records in a recordset $row = Mysql_fetch_row ($rs);? >
 
  
 <title>Pagination shows the recordset</title>
 
  
    \ n "); $colNum = Mysql_num_fields ($RSALL); for ($i = 0; $i < $colNum; $i + +) {$meta = Mysql_fetch_field ($RSALL); printf ("
 
  
  \ n ", $meta->name);} Print (" 
   \ n ");d o {print (" 
   
     \ n "); for ($i =0; $i < $maxRows; $i + +) printf (" 
    \ n ", $row [$i]); Print (" 
   \ n ");} while ($row = Mysql_fetch_row ($rs));? > 
  
pagination shows the recordset
%s
%s

Pagination I have a lot, use the above search code does not work (the search code can be used), my paging is available elsewhere

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.