2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 08:13:42 +00:00
|
|
|
<!-- $Revision$ -->
|
2008-01-02 14:27:37 +00:00
|
|
|
<refentry xml:id="mysqli-stmt.param-count" xmlns="http://docbook.org/ns/docbook">
|
2005-04-26 14:33:31 +00:00
|
|
|
<refnamediv>
|
2012-01-10 08:58:41 +00:00
|
|
|
<refname>mysqli_stmt::$param_count</refname>
|
2005-04-26 14:33:31 +00:00
|
|
|
<refname>mysqli_stmt_param_count</refname>
|
|
|
|
<refpurpose>Returns the number of parameter for the given statement</refpurpose>
|
|
|
|
</refnamediv>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2010-05-08 21:20:24 +00:00
|
|
|
<para>&style.oop;</para>
|
2012-01-10 10:37:32 +00:00
|
|
|
<fieldsynopsis><type>int</type><varname linkend="mysqli-stmt.param-count">mysqli_stmt->param_count</varname></fieldsynopsis>
|
2010-05-08 21:20:24 +00:00
|
|
|
<para>&style.procedural;</para>
|
2008-01-02 14:27:37 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>mysqli_stmt_param_count</methodname>
|
|
|
|
<methodparam><type>mysqli_stmt</type><parameter>stmt</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2007-01-27 17:37:36 +00:00
|
|
|
<para>
|
2007-01-28 04:25:58 +00:00
|
|
|
Returns the number of parameter markers present in the prepared statement.
|
2007-01-27 17:37:36 +00:00
|
|
|
</para>
|
2005-04-26 14:33:31 +00:00
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
2005-04-26 14:33:31 +00:00
|
|
|
<para>
|
2007-01-28 04:25:58 +00:00
|
|
|
<variablelist>
|
|
|
|
&mysqli.stmt.description;
|
|
|
|
</variablelist>
|
2005-04-26 14:33:31 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2005-04-26 14:33:31 +00:00
|
|
|
<para>
|
2007-01-28 04:25:58 +00:00
|
|
|
Returns an integer representing the number of parameters.
|
2005-04-26 14:33:31 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="examples">
|
2005-04-26 14:33:31 +00:00
|
|
|
&reftitle.examples;
|
|
|
|
<example>
|
2010-08-06 15:40:41 +00:00
|
|
|
<title>&style.oop;</title>
|
2005-04-26 14:33:31 +00:00
|
|
|
<programlisting role="php">
|
2004-03-09 17:21:48 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
|
|
|
|
|
|
|
/* check connection */
|
|
|
|
if (mysqli_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($stmt = $mysqli->prepare("SELECT Name FROM Country WHERE Name=? OR Code=?")) {
|
|
|
|
|
|
|
|
$marker = $stmt->param_count;
|
|
|
|
printf("Statement has %d markers.\n", $marker);
|
|
|
|
|
|
|
|
/* close statement */
|
|
|
|
$stmt->close();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* close connection */
|
|
|
|
$mysqli->close();
|
|
|
|
?>
|
|
|
|
]]>
|
2010-05-08 23:37:27 +00:00
|
|
|
</programlisting>
|
2010-08-06 15:40:41 +00:00
|
|
|
</example>
|
|
|
|
<example>
|
|
|
|
<title>&style.procedural;</title>
|
2005-04-26 14:33:31 +00:00
|
|
|
<programlisting role="php">
|
2004-03-09 17:21:48 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
|
|
|
|
|
|
|
|
/* check connection */
|
|
|
|
if (mysqli_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($stmt = mysqli_prepare($link, "SELECT Name FROM Country WHERE Name=? OR Code=?")) {
|
|
|
|
|
|
|
|
$marker = mysqli_stmt_param_count($stmt);
|
|
|
|
printf("Statement has %d markers.\n", $marker);
|
|
|
|
|
|
|
|
/* close statement */
|
|
|
|
mysqli_stmt_close($stmt);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* close connection */
|
|
|
|
mysqli_close($link);
|
|
|
|
?>
|
|
|
|
]]>
|
2005-04-26 14:33:31 +00:00
|
|
|
</programlisting>
|
2010-05-08 23:37:27 +00:00
|
|
|
&examples.outputs;
|
|
|
|
<screen>
|
2004-03-09 17:21:48 +00:00
|
|
|
<![CDATA[
|
|
|
|
Statement has 2 markers.
|
|
|
|
]]>
|
2010-05-08 23:37:27 +00:00
|
|
|
</screen>
|
|
|
|
</example>
|
2005-04-26 14:33:31 +00:00
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>mysqli_prepare</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2005-04-26 14:33:31 +00:00
|
|
|
</refentry>
|
2004-03-09 17:21:48 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2004-03-09 17:21:48 +00:00
|
|
|
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
|
|
|
|
-->
|