The function is part of $this and it passes in a MySQL query which has a few ? marks. The parameters get filled in through the execute and the results are being loaded into a separate object. Does this object (requesting the script) need to be passed in the runSelect() and does $STH really need to exist or can it be translated to a part of $this?
public function runSelect($query, $param, $obj){
try {
$STH = $this->dbh->prepare($query);
$STH->setFetchMode(PDO::FETCH_INTO, $obj);
$STH->execute($param);
$STH->fetch();
} catch(PDOException $e) {
echo $e->getMessage();
}
return($obj);
}
No.
Yes.
Yes.