Paging query: Using a paged class query with Get value

Source: Internet
Author: User

<body><?PHP$cx= "";if(!Empty($_get["CX"]) //To determine if the value passed by get is not NULL, then assign the passed value to the variable $cx{$cx=$_get["CX"]; }? ><form action= "fenyechaxun.php" method= "Get" >Key Words:<input type= "text" Name= "CX"value= "<?php echo $cx;?>"/><input type=" submit "value=" Query "/>//Leave the user input keyword in the text box ' text '<table width= "100%" border= "1" cellpadding= "0" cellspacing= "0" ><tr> <td>areacode</td> <td    >areaname</td> <td>parentareacode</td> <td>root</td> <td>zone</td> <td>nacigateurl</td></tr><?PHPinclude(".. /fzl/czy.class.php ");$db=NewCzy ();$TJ= "1=1"; //Condition $tj= ' 1=1 ', point search is search all; if(!Empty($_get["CX"]) &&$_get["CX"]! = "") //If get passed the value $_get["CX"] non-empty and not empty string is to add $TJ behind the SQL statement {$TJ= "AreaName like '%{$_get[' CX ']} %‘ "; }$stotal = "SELECT count (*) from chinastates where {$tj}"; The total number of bars in the database $arr = $db->strquery ($stotal);include(".. /fzl/page.class.php ");$page = new page ($arr), $sql = "SELECT * from Chinastates where {$TJ}". $page->limit; Page pagination$attr=$db->query ($sql);foreach($attr  as $v){    Echo"<tr> <td>{$v[0]}</td> <td>{$v[1]}</td> <td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$v[4]}</td> <td>{$v[5]}</td> </tr>"; }? ></table></form><?PHPecho $page->fpage (); Page pagination?></body>

Paging query: Using a paged class query with Get value

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.