|
PHP5中文手册
mysqli_preparemysqli->prepare()(PHP 5) mysqli->prepare() — Prepare a SQL statement for execution 说明Procedure style:
mysqli_stmt mysqli_prepare
( mysqli $link
, string $query
)
Object oriented style (method) mysqli
mysqli_stmt prepare
( string $query
)
Prepares the SQL query pointed to by the null-terminated string query, and returns a statement handle to be used for further operations on the statement. The query must consist of a single SQL statement. The parameter markers must be bound to application variables using mysqli_stmt_bind_param() and/or mysqli_stmt_bind_result() before executing the statement or fetching rows. 参数
返回值mysqli_prepare() returns a statement object or FALSE if an error occured. 范例Example#1 Object oriented style
<?php Example#2 Procedural style
<?php 上例将输出:
|