When paging jumps, guarantee the query condition
foreach ($map as $key = = $val) {
$page->parameter. = "$key =". UrlEncode ($val) .&;
}
Copy CodeDebugging will find that when $map is not an array, then the variable cannot get
This article introduced the thinkphp in a key to clear the cache method, the implementation of a thinkphp cleanup cache function, can effectively alleviate the server pressure, need to refer to the friend.
thinkphp implement one-click
$page =isset ($_get[' page ')? Intval ($_get[' page '): 1; Gets the value of the page in page=18, and if there is no page, the number of pages is 1.
$num = 10; Show 10 data per page
$db =mysql_connect ("host", "name", "Pass"); Create a
Forge an array of 100,000 array elements, the first array element is 1, and the subsequent 99,999 are 0
for ($i =0; $i
if ($i ==1)
Array_push ($array, 1);
Else
Array_push ($array, 0);
}
The
/* Check to see if the original file exists and get information about the original file */
$org _info = @getimagesize ($img);
$img _org = $this->img_resource ($img, $org _info[2]);
/* The original picture and the size ratio of
Strtotime ("2009-1-22″")
Echo strtotime ("2009-1-22″) Results: 1232553600
Copy CodeDescription: Return January 22, 2009 0:0 0 seconds timestampSecond, PHP timestamp function gets the English text date time is easy to compare, use
From time to time we can hear someone saying that we need more programmers. Now children should learn to program in school. The status of programming should be the same as the written text. I disagree with the view that there will be people on the
}
Connect to the local MySQL database and select test as the action library
$mysqli = Mysqli_connect ("localhost", "root", "" "," Test ", 3306);
Using the Mysql_query function to read data from the
if ($_get[' count ']) {
$count = $_get[' count '];
} else {
$count =select Count (*) from TableName where .....
}
Copy CodeIf only the first page of the total count, the number of pages are not used, so
PHP Paging Code
bbs.it-home.org
Include ("conn.php");
$pagesize =5;//Show records per page
$startrow =0;//Current Page record header
if (Empty ($_get[' PageNo ')) {
if ($startrow ==0) {
$pageno = $startrow +1;
/************************************
Class Name: Pagesupport
Features: pagination displays data from MySQL database
*************************************/
Class pagesupport{
Property
var $sql;//SQL query statement to
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