How To Save Datetime With PHP PDO

前端 未结 1 1794
迷失自我
迷失自我 2021-01-14 08:02

I want to execute following PDO statement

\"INSERT INTO `vk_posts` (`date`, `text`) VALUES (\':date\', \':text\')\"

Where :date is datetime

相关标签:
1条回答
  • 2021-01-14 08:22

    The placeholder names should not be quoted. Remove the quotes around :date and :text, so it becomes:

    "INSERT INTO `vk_posts` (`date`, `text`) VALUES (:date, :text)"
    
    0 讨论(0)
提交回复
热议问题