I'm working on web app that require a login page, everything work fine but i noticed that when a user try to connect and his password contain caracter he can't and an ugly error appear says FATAL ERROR:Call to a member function rowCount() on a non-object
.
here is my code:
$password=$_GET["password"];
$req="SELECT * FROM `enseignant` WHERE ens_cin=$login AND ens_pass=$password";
$res=$idconnex->query($req);
if($res->rowCount() > 0)
{echo 'SUCCESS CONNECT';}
else
{echo 'FAIL CONNECT';}
when i tried to add !empty($result)
in if()
,thing goes worst.. it conseder all those how has caracteres in thier pass as not signed in user!! but no error appear..
thanks for help and sorry for my bad English.