I have some difficulties with inserting date (type: datetime) into my database. Whatever I put there, it throws me syntax errors about the date format etc. Could someone help me please?
DB::insert('INSERT INTO hidden_authors (e_user = ? AND h_user = ? AND h_change_time = ?)', array($userBanId, $id, date(Y-m-d H:i:s) ));
I have already tried to use sql getdate() but it also gives me an error.
date()e_user.h_change_timeshould be atimestampfield in the database anyway - withON UPDATE CURRENT_TIMESTAMP... which would make this entire question moot.