Understanding Mysql prepare preprocessing statements, mysqlprepare
MySQL 5.1 supports premade statements on the server side. If you use a suitable client programming interface, this support can take advantage of the efficient client/server binary
MySQL 5.1 provides support for prefabricated statements on the server side. If you use the appropriate client-side programming interface, this support can play the advantage of an efficient client/server binary protocol implemented in MySQL 4.1. The
Mysql-prepare statementsFeature Description:MySQL Prepare statement usageIn order to prepare the statement using MySQL, you need to use the other three MySQL statements as follows:PREPARE -The statement that is ready to be executed.Execute -executes
{Code...} Then {code ...}
$ Db = new PDO (); $… = $ db-> prepare ('SQL'); // you can obtain the execution SQL using a method similar to getSql =
Then
$ Db = new PDO (); $… = $ db-> prepare ('select * from 'table' where p1 =: p1 limit: limit '); $
$db = new PDO();$sth = $db->prepare('sql');// 有木有一个类似getSql的方法可以获取执行的SQL的= =
And then
$db = new PDO();$sth = $db->prepare('select * from `table` where p1 = :p1 limit
Mysqli compared to MySQL has many advantages, we recommend that you use, if not understand, you can view the basic MySQL tutorial: mysqli connection Database and mysqli preprocessing prepare use. Not only that, mysqli more support multi-query
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.