So far made such a request

mysqli_query($CONNECT, ' UPDATE `agrousadby` SET `date` = NOW() WHERE `id` = '.$Param['id'].' AND `date` < (NOW() - INTERVAL 7 DAY)) '); 

but does not work. Writes a "SQL query syntax error" (You have an error in your SQL syntax).

    1 answer 1

    As far as I can see, you have an extra bracket at the end of the query. It should be like this:

     mysqli_query($CONNECT, ' UPDATE `agrousadby` SET `date` = NOW() WHERE `id` = '.$Param['id'].' AND `date` < (NOW() - INTERVAL 7 DAY) '); 

    Please specify what it means "not working." The request may not return the required data, but may fall with a syntax error. A bracket is easy to miss and go the wrong way in search.

    • Yes, there was an extra bracket, but someone can use the code anyway) - Vadim Moroz