I have been working on a Login/Register System, I had it all set up and working perfectly in MySQL, but I need to run it from SQL SERVER 2008, so I have changed the connection over and its all working apart from 1 bit, when the user click a verification link i the email it isn't verifying the user so I am thinking that some of the syntax doesn't work with PHP7 and SQL server.
This is the code:
$stmt = $user->runQuery("SELECT userID,userStatus FROM tbl_users WHERE userID=:uID AND tokenCode=:code LIMIT 1");
$stmt->execute(array(":uID"=>$id,":code"=>$code));
$row=$stmt->fetch(PDO::FETCH_ASSOC);
if($stmt->rowCount() > 0){
some code...}
else{ error message...}
Its skipping the if statement and just giving me the error message from the else.
Is there something obviously wrong that i am not seeing?
Any help would be appreciated at this point!!
Thanks.
EDIT:
This is the code form the IF statement if it helps...
if($row['userStatus']==$statusN)
{
$stmt = $user->runQuery("UPDATE po_users SET userStatus=:status WHERE userID=:uID");
$stmt->bindparam(":status",$statusY);
$stmt->bindparam(":uID",$id);
$stmt->execute();
$msg = "
<div class='alert alert-success'>
<button class='close' data-dismiss='alert'>×</button>
<strong>WoW !</strong> Your Account is Now Activated : <a href='index.php'>Login here</a>
</div>
";
}
else
{
$msg = "
<div class='alert alert-error'>
<button class='close' data-dismiss='alert'>×</button>
<strong>sorry !</strong> Your Account is allready Activated : <a href='index.php'>Login here</a>
</div>
";
}
rowCountLIMIT, useSELECT TOPinsteadcount($row)maybe.