Error # 1064 in mySQL query

I get the following error in the following query:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')))' at line 1 

Code snippet:

 INSERT INTO test_bans( ip, Expiration ) VALUES ( "0.0.0.0", DateAdd( "d", 1, Date( ) ) ) 

Table creation request

 CREATE TABLE test_bans ( ID smallint(6) NOT NULL AUTO_INCREMENT, IP text NOT NULL, Expiration DATETIME NOT NULL, PRIMARY KEY (ID) ) TYPE=MyISAM; 

What am I missing?

Edit, after executing this request, I received this error. I think my question is ew: how to add a day to my current timestamp?

 #1305 - FUNCTION optimuscprime.DateAdd does not exist 

Query:

  INSERT INTO test_bans( ip, Expiration ) VALUES ( "0.0.0.0", DateAdd( "d", 1, CURRENT_TIMESTAMP ) ) 
+4
source share
3 answers

Try using plain SQL rather than MySQL dialogs:

 INSERT INTO test_bans( ip, Expiration ) VALUES ( '0.0.0.0', (NOW() + INTERVAL 1 DAY) ); 
+4
source

DATE () accepts arguments, you must use NOW () to use the current date / time or other date functions.

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

As for day +1 .. in PHP, I would do something like:

 strtotime('+1 day', time()); 

You can also use INTERVAL with MySQL with the link provided.

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add

+3
source

DATE() must have an argument. You can use NOW() instead.

+3
source

Source: https://habr.com/ru/post/1305362/