function.maxdb-stmt-bind-param.html

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

HTML
252
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Binds variables to a prepared statement as parameters</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="function.maxdb-stmt-affected-rows.html">maxdb_stmt_affected_rows</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.maxdb-stmt-bind-result.html">maxdb_stmt_bind_result</a></div> <div class="up"><a href="ref.maxdb.html">MaxDB Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.maxdb-stmt-bind-param" class="refentry"> <div class="refnamediv">  <h1 class="refname">maxdb_stmt_bind_param</h1>  <h1 class="refname">stmt-&gt;bind_param</h1>  <p class="verinfo">(PECL maxdb:1.0-7.6.00.38)</p><p class="refpurpose"><span class="refname">maxdb_stmt_bind_param</span> -- <span class="refname">stmt-&gt;bind_param</span> &mdash; <span class="dc-title">Binds variables to a prepared statement as parameters</span></p> </div> <div class="refsect1 description">  <h3 class="title">Description</h3>  <p class="para">Procedural style:</p>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><b>maxdb_stmt_bind_param</b></b></span>    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$stmt</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$types</tt></span>   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter reference">&$var1</tt></span>   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter reference">&$...</tt></span>  ] )</div>  <p class="para rdfs-comment">Object oriented style (method):</p>  <div class="classsynopsis">   <div class="ooclass"><b class="classname">stmt</b></div>   <div class="methodsynopsis dc-description">    <span class="type">bool</span>      <span class="methodname"><b><b>bind_param</b></b></span>     ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$types</tt></span>    , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter reference">&$var1</tt></span>    [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <tt class="parameter reference">&$...</tt></span>   ] )</div>  </div>  <p class="para">Procedural style (extended syntax):</p>  <div class="methodsynopsis dc-description">   <span class="type">bool</span> <span class="methodname"><b><b>maxdb_stmt_bind_param</b></b></span>    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$stmt</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$types</tt></span>   , <span class="methodparam"><span class="type">array</span> <tt class="parameter reference">&$var</tt></span>   )</div>  <p class="para rdfs-comment">Object oriented style (method) (extended syntax):</p>  <div class="classsynopsis">   <div class="ooclass"><b class="classname">stmt</b></div>   <div class="methodsynopsis dc-description">    <span class="type">bool</span>      <span class="methodname"><b><b>bind_param</b></b></span>     ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$types</tt></span>    , <span class="methodparam"><span class="type">array</span> <tt class="parameter reference">&$var</tt></span>    )</div>  </div>  <p class="para">   <b>maxdb_stmt_bind_param()</b> is used to bind variables for the   parameter markers in the SQL statement that was passed to   <a href="function.maxdb-prepare.html" class="function">maxdb_prepare()</a>.   The string <i><tt class="parameter">types</tt></i> contains one or more characters which specify   the types for the corresponding bind variables.  </p>  <p class="para">   The extended syntax of <b>maxdb_stmt_bind_param()</b> allows to give the parameters   as an array instead of a variable list of PHP variables to the function. If the array variable has not been   used before calling <b>maxdb_stmt_bind_param()</b>, it has to be initialized as an emtpy   array. See the examples how to use <b>maxdb_stmt_bind_param()</b> with extended syntax.  </p>  <p class="para">   Variables for SELECT INTO SQL statements can also be bound using <b>maxdb_stmt_bind_param()</b>.   Parameters for database procedures can be bound using <b>maxdb_stmt_bind_param()</b>. See the   examples how to use <b>maxdb_stmt_bind_param()</b> in this cases.  </p>  <p class="para">   If a variable bound as INTO variable to a SQL statement was used before, the content of this variable   is overwritten by the data of the SELECT INTO statement. A reference to this variable will be invalid after a call to   <b>maxdb_stmt_bind_param()</b>.

⌨️ 快捷键说明

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