Re: docs on mysqli_query return values are incorrect.
[email protected] (Kamil Tekiela)
| Newsgroups | php.doc |
|---|---|
| Message-ID | <CAGBsUrdKJkZm-Tk6kjsU0kJVU8ptvUas8queNYTv3HAaGjDasg@mail.gmail.com> |
The documentation is correct (at least that part) but what you have encountered is a bug, either in mysqli or in MySQL. Please file a bug report on https://bugs.php.net/ and we will look into it. On Tue, 5 Jan 2021 at 00:12, j adams <[email protected]> wrote: > Hello! Apologies if I'm emailing the wrong list. > > 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; > > This query will return a result set with two records whether the table > exists or not. > > > I believe I found the file that should be altered on github here: > > https://github.com/php/doc-en/blob/master/reference/mysqli/mysqli/query.xml#L111 > > I do not know what the return value description should be under all the > various circumstances. >