0
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 to do is to finish the "lost" this stick to the current date.
Have you seen the function
NOW()
mysql?– Max Rogério
Good I’ve tried with NOW() the only thing that happens so much with one another is the field get the value NULL.
– slydor37
Good afternoon, After some rest I found the solution.
– slydor37