Mahbs Mahbs - 1 month ago 6
SQL Question

Keyword Not Recognized error in PhpMyAdmin

I have a query that I've been trying to execute on

phpMyAdmin
, the query is as follows:

UPDATE `energyconsumption` SET `Date`= CURRENT_DATE, WHERE USER = '17';


This is response that I get back:

2 errors were found during analysis.


Unrecognized keyword. (near "CURRENT_DATE" at position 39)

Unexpected token. (near "," at position 51)


How do I resolve this error? And how do I use
CURRENT_DATE
in the correct way?

Note:

I've searched online about the correct way of using the function
CURRENT_DATE
, but I haven't had much luck on find a good site that explains it. Also, w3schools website has been down since yesterday so I haven't had the chance to look there on the correct syntax for using this function.

Thank you in advance!

Answer

use now() instead of CURRENT_DATE and remove the ,