2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 07:54:14 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.maxdb-stmt-param-count">
|
2007-01-29 16:56:02 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>maxdb_stmt_param_count</refname>
|
2012-01-12 05:58:52 +00:00
|
|
|
<refname>maxdb_stmt::param_count</refname>
|
2007-01-29 16:56:02 +00:00
|
|
|
<refpurpose>Returns the number of parameter for the given statement</refpurpose>
|
|
|
|
</refnamediv>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2010-05-09 03:09:46 +00:00
|
|
|
<para>&style.procedural;</para>
|
2007-01-29 16:56:02 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>maxdb_stmt_param_count</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>stmt</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2010-05-09 02:51:44 +00:00
|
|
|
<para>&style.oop;</para>
|
2012-01-13 14:20:43 +00:00
|
|
|
<fieldsynopsis><type>int</type><varname>maxdb_stmt->param_count</varname></fieldsynopsis>
|
2007-01-29 16:56:02 +00:00
|
|
|
<para>
|
|
|
|
<function>maxdb_stmt_param_count</function> returns the number of parameter
|
|
|
|
markers present in the prepared statement.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
2007-01-29 16:56:02 +00:00
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
returns an integer representing the number of parameters.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-01-29 16:56:02 +00:00
|
|
|
<example>
|
2012-01-11 06:50:17 +00:00
|
|
|
<title>&style.oop;</title>
|
2007-01-29 16:56:02 +00:00
|
|
|
<programlisting role="php">
|
2005-03-08 16:39:06 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
|
|
|
|
|
|
|
|
/* check connection */
|
|
|
|
if (maxdb_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", maxdb_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($stmt = $maxdb->prepare("SELECT name FROM hotel.city WHERE name=? OR state=?")) {
|
|
|
|
|
|
|
|
$marker = $stmt->param_count;
|
|
|
|
printf("Statement has %d markers.\n", $marker);
|
|
|
|
|
|
|
|
/* close statement */
|
|
|
|
$stmt->close();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* close connection */
|
|
|
|
$maxdb->close();
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-29 16:56:02 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
<example>
|
2012-01-11 06:50:17 +00:00
|
|
|
<title>&style.procedural;</title>
|
2007-01-29 16:56:02 +00:00
|
|
|
<programlisting role="php">
|
2005-01-12 18:53:25 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2005-03-08 16:39:06 +00:00
|
|
|
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
|
2005-01-12 18:53:25 +00:00
|
|
|
|
|
|
|
/* check connection */
|
|
|
|
if (maxdb_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", maxdb_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($stmt = maxdb_prepare($link, "SELECT name FROM hotel.city WHERE name=? OR state=?")) {
|
|
|
|
|
|
|
|
$marker = maxdb_stmt_param_count($stmt);
|
|
|
|
printf("Statement has %d markers.\n", $marker);
|
|
|
|
|
|
|
|
/* close statement */
|
|
|
|
maxdb_stmt_close($stmt);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* close connection */
|
|
|
|
maxdb_close($link);
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-29 16:56:02 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
2008-06-04 08:18:53 +00:00
|
|
|
&example.outputs.similar;
|
2007-01-29 16:56:02 +00:00
|
|
|
<screen>
|
2005-01-12 18:53:25 +00:00
|
|
|
<![CDATA[
|
|
|
|
Statement has 2 markers.
|
|
|
|
]]>
|
2007-01-29 16:56:02 +00:00
|
|
|
</screen>
|
|
|
|
</refsect1>
|
2007-06-16 19:11:13 +00:00
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>maxdb_prepare</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-01-29 16:56:02 +00:00
|
|
|
</refentry>
|
2005-01-12 18:53:25 +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"
|
2005-01-12 18:53:25 +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
|
|
|
|
-->
|