Click here to Skip to main content
15,911,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am implementing PDO in my code . this is how i did it ,i am getting an error message on line 221 as ...HipHop Warning: Creating default object from empty value in /var/www/webApp/services/CurrencyService.php on line 221 . please check and verify where i am going wrong.

public function getExchangeRate($curr) {

$stmt = $this->vConnection->prepare("SELECT rate FROM $this->tablename where curr=?");
$this->throwExceptionOnError();

$stmt->bindparam(1, $curr);
$this->throwExceptionOnError();

$stmt->execute();
$this->throwExceptionOnError();
$stmt->bindColumn(1, $row->rate); //line 221

if($row = $stmt->fetch()) {
return $row;
} else {
return null;
}
}
Posted
Comments
Morgan Estes 12-Nov-13 11:47am    
Have you checked to see if there's a value in `$row->rate`? Try a `var_dump($row->rate)` or `var_dump($row)` to see what's going on with it, and if there's anything in there for `bindColumn()` to work with.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900