2

I am getting a PHP warning when running a query in phpMyAdmin that includes both parentheses and a LIMIT statement. For example:

(SELECT * FROM tableA LIMIT 1)

The warning is:

A non-numeric value encountered

I am using PHP version 7.2 and MySQL 5.6.42 and phpMyAdmin version 4.9.0.1

What might cause this warning?

EDIT:

My issue is not a duplicate of this, because no matter which column or table I use, I get the same warning

EDIT2: Because people asked for an actual UNION query:

(SELECT name FROM tableA LIMIT 1)
UNION
(SELECT name FROM tableB LIMIT 1)

This was the scenario I encountered the warning.

miken32
  • 42,008
  • 16
  • 111
  • 154
JoeBe
  • 1,224
  • 3
  • 13
  • 28
  • 3
    Why do you use parenthesis for this query? – Paul Spiegel Jun 21 '19 at 18:44
  • 1
    Possible duplicate of [Warning: A non-numeric value encountered](https://stackoverflow.com/questions/42044127/warning-a-non-numeric-value-encountered) – Alireza A2F Jun 21 '19 at 18:45
  • I am not using this particular query. I encountered the warning when performing a `UNION` in which I use a `LIMIT` statement in both subqueries, which is why I need to use parentheses – JoeBe Jun 21 '19 at 18:45
  • @AlirezaA2F I also get the warning if I only ask for a string column in the `SELECT`, e.g. `(SELECT name FROM tableA LIMIT 1)` – JoeBe Jun 21 '19 at 18:48
  • 1
    Then post the UNION query. – Paul Spiegel Jun 21 '19 at 18:48
  • Please add your php code to your post. – Alireza A2F Jun 21 '19 at 18:49
  • @PaulSpiegel I think this is not necessary, because it does not add more info to the question. I encountered that all statements I am doing (no matter which table I use or which column), whenever I have parentheses with a `LIMIT` statment I am getting this warning – JoeBe Jun 21 '19 at 18:50
  • Well.. I can reproduce the issue with a valid UNION query.. It's clearly a bug in phpMyAdmin – Paul Spiegel Jun 21 '19 at 18:51
  • @PaulSpiegel OK... So nothing much I can do about it (?) – JoeBe Jun 21 '19 at 19:07
  • It's a warning - You still get the result right? In the phpMyAdmin demo I can click on "Ignore". If you want to be a "good citizen", you should report the bug. – Paul Spiegel Jun 21 '19 at 19:10
  • @PaulSpiegel Yes, I am getting the results. Do you think it is a phpMyAdmin problem or a PHP 7.x issue (as explained in the linked thread)? Depending on what it is I would report it. – JoeBe Jun 21 '19 at 19:13
  • 2
    IMHO it's a bug in phpMyAdmin. If there is a problem with PHP, they (the phpMyAdmin developers) can report it to the PHP devs. – Paul Spiegel Jun 21 '19 at 19:19
  • It sounds like phpMyAdmin wasn't updated to be compatible with this change in PHP 7.x. – Barmar Jun 21 '19 at 20:12
  • @PaulSpiegel How could you reproduce my issue? Because I am not able reproducing it on phpmyadmin's demo server for them to see the warning – JoeBe Jun 22 '19 at 14:38
  • The demo doesn't work for me right now - so I can't run the test again. I used [this query](https://dbfiddle.uk/?rdbms=mysql_5.7&fiddle=4a32753f7cd57b4ad76342187239dbe5) – Paul Spiegel Jun 22 '19 at 14:43

0 Answers0