📄 function.db2-bind-param.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Binds a PHP variable to an SQL statement parameter</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.db2-autocommit.html">db2_autocommit</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.db2-client-info.html">db2_client_info</a></div> <div class="up"><a href="ref.ibm-db2.html">IBM DB2 Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.db2-bind-param" class="refentry"> <div class="refnamediv"> <h1 class="refname">db2_bind_param</h1> <p class="verinfo">(PECL ibm_db2:1.0-1.6.2)</p><p class="refpurpose"><span class="refname">db2_bind_param</span> — <span class="dc-title"> Binds a PHP variable to an SQL statement parameter </span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>db2_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">int</span> <tt class="parameter">$parameter-number</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$variable-name</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$parameter-type</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$data-type</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$precision</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$scale</tt></span> ]]]] )</div> <p class="para rdfs-comment"> Binds a PHP variable to an SQL statement parameter in a statement resource returned by <a href="function.db2-prepare.html" class="function">db2_prepare()</a>. This function gives you more control over the parameter type, data type, precision, and scale for the parameter than simply passing the variable as part of the optional input array to <a href="function.db2-execute.html" class="function">db2_execute()</a>. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">stmt</tt></i></span> <dd> <p class="para"> A prepared statement returned from <a href="function.db2-prepare.html" class="function">db2_prepare()</a>. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">parameter-number</tt></i></span> <dd> <p class="para"> Specifies the 1-indexed position of the parameter in the prepared statement. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">variable-name</tt></i></span> <dd> <p class="para"> A string specifying the name of the PHP variable to bind to the parameter specified by <i><tt class="parameter">parameter-number</tt></i>. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">parameter-type</tt></i></span> <dd> <p class="para"> A constant specifying whether the PHP variable should be bound to the SQL parameter as an input parameter (<i>DB2_PARAM_IN</i>), an output parameter (<i>DB2_PARAM_OUT</i>), or as a parameter that accepts input and returns output (<i>DB2_PARAM_INOUT</i>). To avoid memory overhead, you can also specify <i>DB2_PARAM_FILE</i> to bind the PHP variable to the name of a file that contains large object (BLOB, CLOB, or DBCLOB) data. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">data-type</tt></i></span> <dd> <p class="para"> A constant specifying the SQL data type that the PHP variable should be bound as: one of <i>DB2_BINARY</i>, <i>DB2_CHAR</i>, <i>DB2_DOUBLE</i>, or <i>DB2_LONG</i> . </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">precision</tt></i></span> <dd> <p class="para"> Specifies the precision with which the variable should be bound to the database. This parameter can also be used for retrieving XML output values from stored procedures. A non-negative value specifies the maximum size of the XML data that will be retrieved from the database. If this parameter is not used, a default of 1MB will be assumed for retrieving the XML output value from the stored procedure.聽 </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">scale</tt></i></span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -