Connecting to a database
$con = mysql_connect ("localhost", "root", "");
mysql_select_db ("Xueshengchu", $con);
mysql_query ("Set names UTF8");
$pageSize = 5; Shows the number of data bars per page
$result =
/*
Author: silently
date:2006-12-03
*/
$page =isset ($_get[' page ')? Intval ($_get[' page ')): 1; This is to get the value of page in Page=18, if there is no page, then the number of pages is 1.
$num = 10; Show 10 data per
$pagesize = 10; Set the number of records to display per page
$conn =mysql_connect ("localhost", "root", ""); Connecting to a database
$rs =mysql_query ("SELECT count (*) from tb_product", $conn); Total Records obtained $RS
$fp = fopen ("Test.txt", "R");
?>
Copy Code2.fclose (Close file) syntax: fclose (filepointer) filepointer, the file pointer to be closed. If successful, the Fclose function returns TRUE if the Fclose function returns FALSE if it
function Test ()
{
$w 3sky = 0;
echo $w 3sky;
$w 3sky++;
}
?>
Copy CodeEach call to this function sets the value of $w 3sky to 0 and outputs "0". Adding a variable to the $w 3sky++ has no effect,
Class page{
Private $total; Total number of records in the data table
Private $listRows; Number of bars to display per page
Private $limit; Limit clauses are used in SQL statements to restrict the number of records obtained
function Checkimagesize ($ImageFileName, $LimitSize)
{
$size =getimagesize ($ImageFileName);
if ($size [0]> $LimitSize [0]| | $size [1]> $LimitSize [1]) {
Echo ' Sorry, the size of the image you want to upload is too
/**
*
* Function: Resize the picture or create a thumbnail image
* Return: True/false
Parameters
* $Image need to adjust the picture (including the path)
* $Dw =450 The maximum width when adjusting; absolute width when
/* 1.jpg to get a picture of its size */
$arr = getimagesize ("1.jpg");
/**
* $arr as an array type
* $arr [0] is the width of the image
* $arr [1] is the height of the image
* $arr [2] format for images,
This paper introduces the method of the automatic expiration of the CodeIgniter database cache, modifies the DB class, sets an expiration time when the cache is turned on, and the expiration auto-cache automatically expires.
CodeIgniter
For PHP image upload with PHP watermark Instance code, a complete example of PHP upload pictures, need to refer to a friend.
1, send.html File Uploader
File Upload Select a file to upload: 2, receive img_
/* 1.jpg you want to get a picture of its size * *
$arr = getimagesize ("1.jpg");
/**
* Here $arr for an array type
* $arr [0] is the width of the image
* $arr [1] is the height of the image
* $arr [2] format for
!--? php
include ("conn.php");//Database link, fix it yourself
$sql = "sel ECT * from news;
$query =mysql_query ($sql);
$all _num=mysql_num_rows ($query);//total number of bars
thinkphp static cache usage, thinkphp static cache configuration method and operation skill, thinkphp built-in static cache function, can directly call the generated HTML cache file, need to refer to the friend.
thinkphp Static Cache
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