
 farid silva aboid - 2012-08-12 22:39:33
Hello, I'm very confused aboud this error. I have a little script to update records in a table and it fails due to "Unknown column 'aprobadoFecha' in 'field list' (1532)"
The script is
$filter["certificadoID"] 	        = $certificadoID;
$update["aprobado"] 		= MySQL::SQLValue(1, MySQL::SQLVALUE_NUMBER);
$update["aprobadoFecha"] 	= MySQL::SQLValue($ahora, MySQL::SQLVALUE_DATETIME);
$update["aprobadoPorID"] 	= MySQL::SQLValue($adminID, MySQL::SQLVALUE_NUMBER);
$success = $db->UpdateRows("Certificados", $update, $filter);
And the table definition is
CREATE TABLE IF NOT EXISTS `Certificados` (
  `certificadoID` int(11) NOT NULL AUTO_INCREMENT,
  `ordenID` int(6) DEFAULT NULL,
  `proveedorID` int(6) DEFAULT NULL,
  `certificadoNum` int(2) DEFAULT NULL,
  `monto` decimal(15,2) DEFAULT NULL,
  `avance` decimal(5,2) DEFAULT NULL,
  `emisionFecha` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `aprobado` int(1) DEFAULT '0',
  `aprobadoFecha` datetime DEFAULT NULL,
  `aprobadoPorID` int(2) DEFAULT NULL,
  `cerrado` int(1) DEFAULT '0',
  `cerradoFecha` datetime DEFAULT NULL,
  `cerradoPorID` int(11) DEFAULT NULL,
  PRIMARY KEY (`certificadoID`),
  UNIQUE KEY `certificadoID` (`certificadoID`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci AUTO_INCREMENT=1 ;
So the column  "aprobadoFecha"   does really exist.
I can't understand that error, but if I cut out the line "$update["aprobadoFecha"] 	= MySQL::SQLValue($ahora, MySQL::SQLVALUE_DATETIME);"
everything works fine.
Any idea about it will be appreciated.
Thanks.