We know that mysqli is the new MySQL interface provided in PHP 5, which uses object-oriented thinking. Code that uses the Mysqli interface is more readable and performs more efficiently than the MySQL interface. And Mysqli provides a multi_query ()
Copy CodeThe code is as follows:
Start caching pictures
Ob_start ();//enable output caching and temporarily cache the content to be output
Imagejpeg ($newimage, False, $quality);//Output
$data = Ob_get_contents ();//Get the cache you just
Set_include_path Setting the default include path
In the include or require file, first look in the default include path, and then in the same directory to find
Cases:
There is a file under D:/xampp/htdocs/test/include for cls.mysqli.php
There is a
Sometimes when we read the database output may need to follow the Chinese user name, the way to sort, the traditional MySQL query code is as follows:
copy code code is as follows:
$sql = "SELECT * from users";//Traditional Query method
The MySQL
Modified: config.inc.php
On the first line join
$ip _prefix = ' 192.168.121. ';if (substr ($_server[' remote_addr '), 0, strlen ($ip _prefix))! = $ip _prefix) die (' Illegal access error ');
IP can be set to the IP of your own computer. If the
JavaScript implementations:
Copy CodeThe code is as follows:
Top.location.href the address of the top-level window this.location.href the address of the current window
PHP Implementation:
Copy CodeThe code is as follows:
#测试网址:
For example:
Copy CodeThe code is as follows:
1 LoadModule php5_module "D:/wamp/bin/php/php5.4.3/php5apache2_2.dll"
2 Phpinidir "D:\wamp\bin\php\php5.4.3"
This way Apache uses the php.ini and PHP DLLs that are loaded in the 5.4.3 version. Let IIS
MySQL Date comparison
To_days (now ())-To_days (Date_col) Our date_col must be a DateTime format, not a timestamp,
Mysql> SELECT from_unixtime (875996580);
' 1997-10-04 22:23:00 '
Day (From_unixtime (1277709862)) This returns the number of days
1. Reinstall the original version of Dedecms in the new space, and then put all the data of the old station, here the data refers to the file, that is, in addition to the root directory under the folder include the configuration file config_base.php
Copy CodeThe code is as follows:
$example = ++$_cookie[' example ');
else $example = 1;
Setcookie ("Example", $example, Time () +54000);
?>
Copy CodeThe code is as follows:
A simple cookie counter
The front hand write a pull-down automatic completion function, write simple, only to achieve the mouse selection function, does not support keyboard selection. Because this feature is used in many areas of the project, you need to do it carefully.
PHP code security and Xss,sql injection are very useful for all types of websites, especially the UGC (User Generated Content) website, forums and e-commerce sites, which are often the hardest hit areas for XSS and SQL injection. Here is a brief
First, install the XCache
Copy CodeThe code is as follows:
# wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz
# tar ZXVF xcache-1.3.0.tar.gz
# CD
The fopen () function is used to open the file in PHP.The first parameter of this function contains the name of the file to be opened, and the second parameter specifies which mode to use to open the file:
Copy CodeThe code is as follows:
$file
Recently collected some questions about thinkphp connection to Oracle database, many friends follow the method of connection to MySQL, cause some methods in Oreale not normal use. For example: The Findall,select method is not available, and the
There is a tricky problem in development today.
Requests that no other controller return information when an asynchronous request is spooled for a large data volume operation. At first it was assumed that the ext frame was created by Ajax
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