2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 08:13:42 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.mysqli-report" xmlns="http://docbook.org/ns/docbook">
|
2007-01-27 17:37:36 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>mysqli_report</refname>
|
|
|
|
<refpurpose>Enables or disables internal report functions</refpurpose>
|
|
|
|
</refnamediv>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-01-27 17:37:36 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>mysqli_report</methodname>
|
|
|
|
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
<function>mysqli_report</function> is a powerful function to improve your queries
|
|
|
|
and code during development and testing phase. Depending on the flags it reports
|
|
|
|
errors from mysqli function calls or queries which don't use an index (or use a bad
|
|
|
|
index).
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>flags</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
<table>
|
|
|
|
<title>Supported flags</title>
|
2011-09-30 14:21:51 +00:00
|
|
|
<tgroup cols="2">
|
2007-01-28 04:25:58 +00:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><constant>MYSQLI_REPORT_OFF</constant></entry>
|
|
|
|
<entry>Turns reporting off</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><constant>MYSQLI_REPORT_ERROR</constant></entry>
|
|
|
|
<entry>Report errors from mysqli function calls</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><constant>MYSQLI_REPORT_STRICT</constant></entry>
|
2010-07-20 09:43:37 +00:00
|
|
|
<entry>
|
|
|
|
Throw <classname>mysqli_sql_exception</classname> for errors
|
|
|
|
instead of warnings
|
|
|
|
</entry>
|
2007-01-28 04:25:58 +00:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><constant>MYSQLI_REPORT_INDEX</constant></entry>
|
|
|
|
<entry>Report if no index or bad index was used in a query</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><constant>MYSQLI_REPORT_ALL</constant></entry>
|
|
|
|
<entry>Set all options (report all)</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
2007-01-27 17:37:36 +00:00
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
2007-01-27 17:37:36 +00:00
|
|
|
<para>
|
2007-01-28 04:25:58 +00:00
|
|
|
&return.success;
|
2007-01-27 17:37:36 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
2010-08-13 10:49:15 +00:00
|
|
|
<refsect1 role="changelog">
|
|
|
|
&reftitle.changelog;
|
|
|
|
<para>
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>&Version;</entry>
|
|
|
|
<entry>&Description;</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2010-08-13 10:51:07 +00:00
|
|
|
<entry>5.2.15 & 5.3.4</entry>
|
2010-08-13 10:49:15 +00:00
|
|
|
<entry>
|
|
|
|
Changing the reporting mode is now be per-request, rather than per-process.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-01-28 04:25:58 +00:00
|
|
|
<refsect1 role="examples">
|
2007-01-27 17:37:36 +00:00
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
2011-12-27 00:34:35 +00:00
|
|
|
<title>&style.oop;</title>
|
2007-01-27 17:37:36 +00:00
|
|
|
<programlisting role="php">
|
2004-02-20 14:45:50 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-02-26 18:32:30 +00:00
|
|
|
/* activate reporting */
|
2004-02-20 14:45:50 +00:00
|
|
|
mysqli_report(MYSQLI_REPORT_ALL);
|
|
|
|
|
2004-02-26 18:32:30 +00:00
|
|
|
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
|
2004-02-20 14:45:50 +00:00
|
|
|
|
2004-02-26 18:32:30 +00:00
|
|
|
/* check connection */
|
|
|
|
if (mysqli_connect_errno()) {
|
|
|
|
printf("Connect failed: %s\n", mysqli_connect_error());
|
|
|
|
exit();
|
|
|
|
}
|
2004-02-20 14:45:50 +00:00
|
|
|
|
2004-02-26 18:32:30 +00:00
|
|
|
/* this query should report an error */
|
|
|
|
$result = $mysqli->query("SELECT Name FROM Nonexistingtable WHERE population > 50000");
|
2004-02-10 05:15:16 +00:00
|
|
|
|
2010-07-20 09:43:37 +00:00
|
|
|
/* this query should report a bad index */
|
2004-02-26 18:32:30 +00:00
|
|
|
$result = $mysqli->query("SELECT Name FROM City WHERE population > 50000");
|
|
|
|
$result->close();
|
2004-02-10 05:15:16 +00:00
|
|
|
|
2004-02-20 14:45:50 +00:00
|
|
|
$mysqli->close();
|
|
|
|
?>
|
|
|
|
]]>
|
2007-01-27 17:37:36 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-01-28 04:25:58 +00:00
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
2012-01-10 07:20:18 +00:00
|
|
|
<member><link linkend="mysqli-driver.props.report-mode">mysqli_driver::$report_mode</link></member>
|
2007-01-28 04:25:58 +00:00
|
|
|
<member><function>mysqli_debug</function></member>
|
|
|
|
<member><function>mysqli_dump_debug_info</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-01-27 17:37:36 +00:00
|
|
|
</refentry>
|
2004-02-10 05:15:16 +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-02-10 05:15:16 +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
|
|
|
|
-->
|