mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 13:58:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150059 c90b9560-bf6c-de11-be94-00142212c4b1
104 lines
3.7 KiB
XML
104 lines
3.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<refentry id="function.mysqli-prepare">
|
|
<refnamediv>
|
|
<refname>mysqli_prepare</refname>
|
|
<refname>stmt->prepare</refname>
|
|
<refpurpose>
|
|
Prepare a SQL statement for execution
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>Procedure style:</para>
|
|
<methodsynopsis>
|
|
<type>mixed</type><methodname>mysqli_prepare</methodname>
|
|
<methodparam><type>object</type><parameter>link</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>Object oriented style (method)</para>
|
|
<classsynopsis>
|
|
<ooclass><classname>stmt</classname></ooclass>
|
|
<methodsynopsis>
|
|
<type>mixed</type>
|
|
<methodname>prepare</methodname>
|
|
<methodparam><type>string</type><parameter>query</parameter></methodparam>
|
|
</methodsynopsis>
|
|
</classsynopsis>
|
|
<para>
|
|
<function>mysqli_prepare</function> 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.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
You should not add a terminating semicolon or <literal>\g</literal>
|
|
to the statement.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
The parameter <parameter>query</parameter> can include one or more parameter markers
|
|
in the SQL statement by embedding question mark (<literal>?</literal>) characters
|
|
at the appropriate positions.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
The markers are legal only in certain places in SQL statements.
|
|
For example, they are allowed in the VALUES() list of an INSERT statement
|
|
(to specify column values for a row), or in a comparison with a column in
|
|
a WHERE clause to specify a comparison value.
|
|
</para>
|
|
<para>
|
|
However, they are not allowed for identifiers (such as table or column names),
|
|
in the select list that names the columns to be returned by a SELECT statement),
|
|
or to specify both operands of a binary operator such as the <literal>=</literal>
|
|
equal sign. The latter restriction is necessary because it would be impossible
|
|
to determine the parameter type. In general, parameters are legal only in Data
|
|
Manipulation Languange (DML) statements, and not in Data Defination Language
|
|
(DDL) statements.
|
|
</para>
|
|
</note>
|
|
<para>
|
|
The parameter markers must be bound to application variables using
|
|
<function>mysqli_bind_param</function> and/or <function>mysqli_bind_result</function>
|
|
before executing the statement or fetching rows.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1>
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
<function>mysqli_prepare</function> returns a statement object or &false; if an error occured.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1>
|
|
&reftitle.seealso;
|
|
<para>
|
|
<function>mysqli_execute</function>
|
|
<function>mysqli_fetch</function>
|
|
<function>mysqli_bind_param</function>
|
|
<function>mysqli_bind_result</function>
|
|
<function>mysqli_stmt_close</function>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|