<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