PHP Classes

Unknown column in 'field list' (1532)

Recommend this page to a friend!

      Ultimate MySQL  >  All threads  >  Unknown column in 'field list' (1532)  >  (Un) Subscribe thread alerts  
Subject:Unknown column in 'field list' (1532)
Summary:The column reported as unknown exists on the table
Messages:1
Author:farid silva aboid
Date:2012-08-12 22:39:33
 

  1. Unknown column in 'field list' (1532)   Reply   Report abuse  
Picture of farid silva aboid 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.