I have the following database:
CREATE TABLE Perdidos' (
'idPerdidos' INT UNSIGNED NOT NULL AUTO_INCREMENT,
'dataEncontrado' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
'descricao' VARCHAR(45) NOT NULL DEFAULT 'Sem descrição',
'quemEncontrou' VARCHAR(45) NOT NULL DEFAULT 'desconhecido',
'localEncontrado' VARCHAR(45) NOT NULL DEFAULT 'Sem local',
'comValorSemValor' INT(1) UNSIGNED NOT NULL,
'estadoDoPerdido' INT(1) NOT NULL DEFAULT '1',
'dataEntrega' TIMESTAMP NULL DEFAULT NULL,
'destinoDoPerdido' INT NOT NULL DEFAULT '1',
'Utilizadores_POR' INT UNSIGNED NOT NULL,
....
php code after connection:
$sql = "UPDATE perdidos SET
dataEntrega = ?
WHERE idPerdidos = ?";
$stmt = $connection->prepare($sql);
$stmt->bindParam(1, $_POST["CURRENT_TIMESTAMP()"]);
$stmt->bindParam(2, $_POST["idPerdidos"]);
$stmt->execute();
What I intend is that at the end of the "lost" it stays with the current date.