PDO (PHPData Object) is new to PHP 5. When Php 6 is coming out, Php 6 only uses PDO for processing by default.Database, Will move all the database extensions to PECL, so the default is no our favorite php_mysql.dll and so on, then how to pinch, we
I. PDO
Represents a connection between a PHP and a database.
Method: pDO-constructor to build a new PDO object
Begintransaction-start transaction
Commit-Submit a transaction
Errorcode-returns an error code from the database, if any
Errorinfo-returns
Difference 1: Throw is an exception thrown by the statement; throws is an exception thrown by the method;
Throw Syntax: Throw
In the method declaration, add the throws clause to indicate that the method will throw an exception. If a method has an
7. Specify the welcome page
What happens if a user provides a URL containing a directory name but not a file name like http: // host/webappprefix/directoryname? Can the user get a directory table? An error? Or standard file content? If the content
Whether there is a graphical option configuration dialog box or a Registry provided by the system, local configuration files in the text form are still the most secure and widely used configuration information storage form. The general mode of
The description of the Java rules described in this article is divided into three main levels. The intermediate level is usually used for development, and other rules will be written in the future. Following these rules can improve the program
Replace error code with exception (replacing the error code with exceptions) http://book.51cto.com 2010-02-03 bear festival translated by People's post and telecommunications press I want to comment (0)
Abstract: refactoring: improving the design
Java exception and throw and try catch:Package com;
Class A extends exception ...{
}
Class B extends ...{
}
Public class test ...{
Public static void main (string [] ARGs )...{
Try ...{
Throw new ();
} Catch (a e )...{
System. Out. println
PHP has many exception handling classes, where exception is the base class for all exception handling.Exception has several basic properties and methods, including the following:Message content for exception messagesCode exception CodesFile name
1. DBQuery object currently, our DBQuery object simply imitates a stored procedure-once executed, it returns a result resource that must be saved; and if you want to use functions in the result set (such as num_rows () or fetch_row (), you must pass
The basic idea of exception handling is that the code is called and executed in try code. If an error occurs in the try code block, we can execute a process for throwing an exception. 1. first, php5 provides the basic exception processing class,
Some problems, can not repeat, such as GBK go to UTF8, and then have in turn into UTF8, this will be garbled, I originally tried to detect the code before the conversion, seemingly failed. I deliberately tried a file, and I checked whether it was
Exception handling is used to change the normal process of a script when a specified error (exception) condition occurs. This condition is called an exception.
PHP 5 adds exception handling modules similar to those in other languages. Exceptions
Cases:
Copy CodeThe code is as follows:
$a = fopen (' test.txt ', ' R ');
There is no judgment on the file opened, if the file does not exist will be an error
?>
Then the correct wording should be as follows:
Copy CodeThe code is as
Design Patterns in PHP Abstract factory patterns
For subclass modes that do not need to be merged, factory output can be completed through multiple methods in a class.
Abstract class messageFactor {abstract function getHeader (); abstract function
PHP implementation of the compression of multiple CSS and JS file method,
This paper describes the PHP implementation of the compression of multiple CSS and JS file method. Share to everyone for your reference. The implementation method is as
Example of a try catch catch exception in PHP, Trycatch
This example describes a try catch catch exception in PHP. Share to everyone for your reference. The specific methods are analyzed as follows:
In PHP, try catch can help us catch the exception
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.