I have been trying this query and researching but I can not understand why it does not work.
The IP record(VARCHAR
) is saved in the table on the database, but I can not save the record DATETIME
, when the record is inserted.
$sql = "INSERT INTO ips (ip, fecha) VALUES (:ip, :CURRENT_TIMESTAMP)";
$stmt = $pdo->prepare($sql);
$stmt->execute(array(
':ip' => htmlentities($_POST['ip']),
':CURRENT_TIMESTAMP' => htmlentities(CURRENT_TIMESTAMP)
));