This code fails to correctly grab my record that is already confirmed (a value of 1 in the confirmed column of my database = confirmed. 0 is not. This user I’m grabbing is indeed confirmed. The return it is returning in this function is the return array(true,“”);
public function activate($activationKey)
$findSub=$this->pdo->prepare("SELECT * FROM Subscribers WHERE activationKey=:activationKey");
$findSub->execute(array(":activationKey" => $activationKey));
$activateSub=$this->pdo->prepare("UPDATE Subscribers SET confirmed=1 WHERE activationKey=:activationKey");
$activateSub->execute(array(":activationKey" => $activationKey));
Can anyone spot the issue? It’s something to do with this line here I think.
string(1) “0” on the first load (correctly being 0.)
string(1) “1” on the second load (correctly being 1.)
Both strings though.
Can you at least confirm whether MySQL always returns results in varchar instead of the data type of the column (e.g. integer?)
Again, I’m not using a PDO placeholder like in that example. I don’t have hte equivalent :numMonths. I pull the result via a select that bases it off the activationKey. And I just happen to pull another column from that result. I am new to PDO so if that example is still transferable to my situation, I don’t see it.