phpmyadmin BUG:预计会有逗号或结束括号

My PHPMyAdmin always warn me

A comma or a closing bracket was expected

when I try to use a function.

Although it displays warnings, the SQL statements can be successfully executed.

For example ,here's a piece of SQL code

    INSERT INTO payments (`amount`,`alloted`, `dateadded`, `modified`, `userid`)
    VALUES ( 100, DATE_ADD( NOW(), INTERVAL 6 MONTH),NOW(),NOW(),139107 )

enter image description here

When typing the function 'NOW()', the red underline comes up, it's really, REAAALYYY annoying

Same errors come up when typing all kinds of sql functions

enter image description here

I've tried re-installing phpmyadmin but it doesn't work at all. This bug only occurs when I'm using ubuntu on my web server, the warning messages never comes up when I debuggling on localhost.

here's the common error message.

Error

Static analysis:

4 errors were found during analysis.

A comma or a closing bracket was expected (near "(" at position 40)
Unexpected token. (near "'123'" at position 41)
Unexpected token. (near ")" at position 46)
Unexpected token. (near ")" at position 47)

SQL query:

INSERT INTO accounts(pw) VALUES(PASSWORD('123'))
  • What version of PHPMyAdmin are you running?
  • And with what version of MySQL?

You probably need to post this on the PHPMyAdmin bugs repository.

It is not a bug with the SQL processing itself; it is a bug with the new PhpMyAdmin SQL validator javasscript and its inferance of the structure of SQL queries.

SQL can be very complex (part of its attraction) so it's to be expected that there will be cases where the validator gets confused.


Also;

INSERT INTO accounts(pw) VALUES(PASSWORD('123'))

Should be:

INSERT INTO accounts(`pw`) VALUES(PASSWORD('123'))

note the backticks. PHPMyAdmin is extremely pernickerty that column names (and table names) be always backtick quoted.

One cause is: If you have columns/fields defined as not null, make sure that corresponding variables in sql are not null or empty as this would prevent the insert