<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.maxdb-warning-count"> <refnamediv> <refname>maxdb_warning_count</refname> <refname>maxdb->warning_count</refname> <refpurpose>Returns the number of warnings from the last query for the given link</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style:</para> <methodsynopsis> <type>int</type><methodname>maxdb_warning_count</methodname> <methodparam><type>resource</type><parameter>link</parameter></methodparam> </methodsynopsis> <para>Object oriented style (property):</para> <classsynopsis> <ooclass><classname>maxdb</classname></ooclass> <fieldsynopsis><type>int</type><varname>warning_count</varname></fieldsynopsis> </classsynopsis> <para> <function>maxdb_warning_count</function> returns the number of warnings from the last query in the connection represented by the <parameter>link</parameter> parameter. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Number of warnings or zero if there are no warnings. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <example> <title>Object oriented style</title> <programlisting role="php"> <![CDATA[ <?php $maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s\n", maxdb_connect_error()); exit(); } $maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city"); /* a remarkable city in Wales */ $query = "INSERT INTO temp.mycity (zip, name) VALUES('11111', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; $maxdb->query($query); printf ("Number of warning: %d\n", $maxdb->warning_count); /* close connection */ $maxdb->close(); ?> ]]> </programlisting> </example> <example> <title>Procedural style</title> <programlisting role="php"> <![CDATA[ <?php $link = maxdb_connect("localhost", "MONA", "RED", "DEMODB"); /* check connection */ if (maxdb_connect_errno()) { printf("Connect failed: %s\n", maxdb_connect_error()); exit(); } maxdb_query($link, "CREATE TABLE temp.mycity LIKE hotel.city"); /* a remarkable long city name in Wales */ $query = "INSERT INTO temp.mycity (zip, name) VALUES('11111', 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"; maxdb_query($link, $query); printf ("Number of warning: %d\n", maxdb_warning_count($link)); /* close connection */ maxdb_close($link); ?> ]]> </programlisting> </example> &example.outputs.similar; <screen> <![CDATA[ Warning: maxdb_query(): -8004 POS(62) Constant must be compatible with column type and length <...> Number of warning: 0 ]]> </screen> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>maxdb_errno</function></member> <member><function>maxdb_error</function></member> <member><function>maxdb_sqlstate</function></member> </simplelist> </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:"~/.phpdoc/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 -->