I'm doing an internal query and I want to get a field ( idperiodo which is integer ), there should only be one record with the field Active that's why I use limit 1 . I have this code:
public function buscar_campo() {
try {
$sql = "SELECT idperiodo FROM periodo WHERE estado = 'A' limit 1";
$BD = new Con();
$resultado = $BD->query($sql);
$fila = $resultado->fetchColum();
$registroVO = new periodoVO();
$registroVO->setPeriodo( $fila['periodo'] );
return $registroVO;
}
}
The error is on line $fila = $resultado->fetchColum();
Sample:
Fatal error: Uncaught Error: Call to undefined method PDOStatement :: fetchColum ()