MySQL I extension of PHP5 is usually used in combination with mysql databases for application systems built using PHP. for a long time, MySQL extension has been accompanied by PHP and MySQL, and provides a channel for interaction between the two.
MYSQLI provides an object-oriented and process-oriented approach to interacting with the database, looking at both of these ways.
1. Object Oriented
In the object-oriented approach, MYSQLI is encapsulated into a class that is constructed as
Objective
In the actual development, PHP will be used with the database, because in the background need to have too much data to save, and the database is a good place to save data, we use PHP development database is a relational database MySQL,
A long time ago, I also because of the work of the bug, the PHP MySQL client connection driver Mysqlnd and libmysql between the difference between PHP and MySQL communication that thing, this time again encountered a connection with their things,
A long time ago, I also studied the difference between mysqlnd and libmysql, the connection driver of phpmysqlclient, and the communication between php and mysql, this time I encountered another thing that had something to do with them, the
Verification of retained re-testPHP API, MySQL with Mysqli's persistent connection area ...A long time ago, I was also because of the work of the bug, the PHP MySQL client connection to drive Mysqlnd and libmysql the difference between PHP and MySQL
Mysqli provides an object-oriented and process-oriented approach to interacting with the database, looking at both of these ways. 1. Object OrientedIn an object-oriented manner, MYSQLI is encapsulated into a class that is constructed as follows:
For the three APIs used by php to connect to the mysql database, refer to the self-php Manual. This article does not make much sense. it is just for your convenience to access the Internet.
1. MySQL extension of PHP2. mysqli extension of PHP3.
1. Connection$mysqli new mysqli ($host,$user,$passwd,$db,$port); if ($mysqli-connect_errno) { echo$mysqli$mysqli- >connect_error; }2. Select query$sql= "SELECT name from Users2"; if(!$mysqli->real_query ($sql)){
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.