Vote count:
0
I'm working on web app that require a login page, everything work until i try to convert to PDO and use prepared quary here is my code:
$req=$idconnex->prepare("SELECT * FROM `enseignant` WHERE ens_cin=:cin AND ens_pass=:pass");
$req->bindParam(':cin',$_GET["login"]);
$req->bindParam(':pass',$_GET["password"]);
$res=$idconnex->exec($req);
if(!empty($res) AND $res->rowCount==1)
{echo 'SUCCESS';}
else
{echo 'FAIL';}
a warning appear say: Warning: PDO::exec() expects parameter 1 to be string, object given in...
and it return FAIL as result even i insert correct param!
asked 28 secs ago
Warning: PDO::exec() expects parameter 1 to be string
Aucun commentaire:
Enregistrer un commentaire