Hello, why do I get that error? this function is to validate if there is a user or not but I get this problem:
Fatal error: Uncaught Error: Call to a member function fetchColumn () on boolean in C: \ xampp \ htdocs \ login_oracle \ funcs \ funcs.php: 50 Stack trace: # 0 C: \ xampp \ htdocs \ login_oracle \ registry.php (38): userExist ('ortega') # 1 {main} thrown in C: \ xampp \ htdocs \ login_oracle \ funcs \ funcs.php on line 50
function userExist ($ user) { global $ db;
$num = $db->query("SELECT COUNT(*) FROM usuarios WHERE DEPARTMENT_ID=". $usuario)->fetchColumn(); //<<<<<<< AQUI ESTA EL PROBLEMA
printf("<script type='text/javascript'>alert('LO DEVUELTO ES : $num'); </script>");
if ($num != 0)
{
return true;
}
else {
return false;
}
}
I could use rowCount but since it is a select this in ORACLE does not work well, only with update, insert or stop. How else can I know the number of rows affected from the last select query I made in PDO ORACLE? or how can I solve that code error. thanks