I found the solution to be a little different to what I expected and I don't believe it's the correct answer to my question still. Thank you for your answers I'm sure they are are both correct but they didn't work for one reason or another :S. I would have used those methods myself anyway.
I used this source code in the end:
//I used $resulte in case of redeclaration.
if($qu->fetch() && $resulte === 1){
$this->_constructSessions($username);
}
else {
//no access
}
I don't why but when using if($result === 1)
the operation would always return false. So I presumed it was returning an string instead. But if you use if($result == 1 && $qu->fetch())
the operation would return false again.
my whole code:
$qu = $this->DBH->prepare("SELECT COUNT(*) FROM CVUSERS WHERE username= ? AND password = ? ");
$qu->bind_param('ss',$username,$password);
$qu->execute();
$qu->bind_result($resulte);
if($qu->fetch() && $resulte === 1){
$this->_constructSessions($username);
}
else {
return array('error'=>true , 'content'=>'<div id="overlay"></div><div id="fail"><h1>Failed login</h1><p><a href="" id="newLogin">Click Here.</a> To request a new login</p><p><a href="" id="try">Or try again?</a></p></div>');
sleep(1);
}
I'm still unsure why this operation works for this query and other don't. If any one can spot anything let me know.