Re: docs on mysqli_query return values are incorrect.
| From: | Anna Filina | Date: | Mon, 11 Jan 2021 15:53:01 +0000 |
| Subject: | Re: docs on mysqli_query return values are incorrect. | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969387793@lists.php.net to get a copy of this message | ||
I opened a PR with that suggesiton. We can continue the conversation in the
comments over there. https://github.com/php/doc-en/pull/324
Anna
On Sun, Jan 10, 2021 at 6:57 AM Rowan Tommins <rowan.collins@gmail.com>
wrote:
> On 5 January 2021 00:12:24 GMT+00:00, j adams <zardozrocks@gmail.com>
> wrote:
> >There is a problem with the return value description for mysqli_query,
> >displayed here:
> >https://www.php.net/manual/en/mysqli.query.php
> >
> >Under 'Return Values,' it says:
> >
> >>Returns *false* on failure. For successful SELECT, SHOW, DESCRIBE or
> >EXPLAIN queries *mysqli_query()* will return a mysqli_result
>
> >><https://www.php.net/manual/en/class.mysqli-result.php>
> >object. For
> >other
> >successful queries *mysqli_query()* will return *true*
> >
> >This is not correct. I can provide one counterexample, which is when
> >you
> >run an optimize query:
> >
> >OPTIMIZE TABLE my_table;
>
>
> Hi,
>
> If I'm understanding this right, I think the documentation just needs to
> be a bit vaguer - there's probably other rare queries that return a result
> set, but the ones listed are the most common. Even if we could list every
> such query now, a new version of MySQL or MariaDB might come out tomorrow
> with a new feature which produced a result set, and the function would
> return a result object for it.
>
>
> Perhaps it should read something like this:
>
> > For queries which produce a result set, such as
> > SELECT, SHOW, DESCRIBE or EXPLAIN, mysqli_query() will return a
> mysqli_result object...
>
> Regards,
>
> --
> Rowan Tommins
> [IMSoP]
>