PHP/PDO insert current date plus one month into MYSQL

前端 未结 1 1393
余生分开走
余生分开走 2021-01-07 16:19

I am trying to add the current date (not time if i have the option) and also the date of one month later into my MYSQL database and I keep gettin the following error:

<
相关标签:
1条回答
  • 2021-01-07 16:39

    Quote your MySQL statements, they're strings in PHP:

    $statement->bindValue(':expires', 'DATE_ADD(now(), INTERVAL 1 MONTH)');
    
    0 讨论(0)
提交回复
热议问题