mysqli.prepare.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 175 行 · 第 1/2 页

HTML
175
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Prepare a SQL statement for execution</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysqli.ping.html">mysqli::ping</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqli.query.html">mysqli::query</a></div> <div class="up"><a href="class.mysqli.html">MySQLi</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="mysqli.prepare" class="refentry"> <div class="refnamediv">  <h1 class="refname">mysqli::prepare</h1>  <h1 class="refname">mysqli_prepare</h1>  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">mysqli::prepare</span> -- <span class="refname">mysqli_prepare</span> &mdash; <span class="dc-title">Prepare a SQL statement for execution</span></p> </div> <div class="refsect1 description">  <h3 class="title">Description</h3>  <p class="para">Object oriented style (method)</p>   <div class="methodsynopsis dc-description">    <span class="type"><span class="type mysqli_stmt">mysqli_stmt</span></span> <span class="methodname"><b><b>prepare</b></b></span>     ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$query</tt></span>    )</div>  <p class="para rdfs-comment">Procedure style:</p>  <div class="methodsynopsis dc-description">   <span class="type"><span class="type mysqli_stmt">mysqli_stmt</span></span> <span class="methodname"><b><b>mysqli_prepare</b></b></span>    ( <span class="methodparam"><span class="type"><a href="class.mysqli.html" class="type mysqli">mysqli</a></span> <tt class="parameter">$link</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$query</tt></span>   )</div>  <p class="para rdfs-comment">   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.  </p>  <p class="para">   The parameter markers must be bound to application variables using   <a href="mysqli-stmt.bind-param.html" class="function">mysqli_stmt_bind_param()</a> and/or    <a href="mysqli-stmt.bind-result.html" class="function">mysqli_stmt_bind_result()</a> before executing the   statement or fetching rows.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt><span class="term"><i><tt class="parameter">link</tt></i></span><dd><p class="para">Procedural style only: A link identifierreturned by <a href="mysqli.connect.html" class="function">mysqli_connect()</a> or <a href="mysqli.init.html" class="function">mysqli_init()</a></p></dd></dt>    <dt>     <span class="term"><i><tt class="parameter">query</tt></i></span>     <dd>      <p class="para">       The query, as a string.      </p>      <blockquote><p><b class="note">Note</b>:                You should not add a terminating semicolon or <i>\g</i>        to the statement.       <br />      </p></blockquote>      <p class="para">       This parameter can include one or more parameter markers in the SQL       statement by embedding question mark (<i>?</i>) characters       at the appropriate positions.      </p>      <blockquote><p><b class="note">Note</b>:                The markers are legal only in certain places in SQL statements.        For example, they are allowed in the <i>VALUES()</i>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?