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>
pagination shows the recordset
\ n "); $colNum = Mysql_num_fields ($RSALL); for ($i = 0; $i < $colNum; $i + +) {$meta = Mysql_fetch_field ($RSALL); printf ("
%s | \ n ", $meta->name);} Print ("
\ n ");d o {print ("
\ n "); for ($i =0; $i < $maxRows; $i + +) printf ("
%s | \ n ", $row [$i]); Print ("
\ n ");} while ($row = Mysql_fetch_row ($rs));? >
Pagination I have a lot, use the above search code does not work (the search code can be used), my paging is available elsewhere