LMSouq
database Open

PHP date() format when inserting into datetime in MySQL

AL
Alex
1 month ago
3 views
Problem Description
What is the correct format to pass to the `date()` function in PHP if I want to insert the result into a MySQL `datetime` type column? I've been trying `date('Y-M-D G:i:s')` but that just inserts "0000-00-00 00:00:00" everytime.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base