I am running a PDO query on a MySQL database and I get an error saying there is invalid argument supplied for the foreach. On the frontend, I just pass a string to $questionTable and an integer for $questionID.
What am I doing wrong?
$query = $this->dbConnection->query("SELECT * FROM ('$questionTable') WHERE id = ('$questionID')");
foreach ($query as $row) {
echo $row;
};