Reputation: 85
$sql=$Db1->query("INSERT INTO TABLENAME SET username='$username', log='Log text here ', date='".date()."'");
The problem is below
username and logs are inserted correctly but date is not saved , it saves 0000-00-00 etc Thanks to solve this
Upvotes: 1
Views: 30
Reputation: 94
Make the date column type in your table as "TIMESTAMP" and change the code to this
$sql=$Db1->query("INSERT INTO TABLENAME SET username='$username', log='Log text here ', date=NULL");
Upvotes: 1