pdo - Invalid argument supplied for foreach in PHP, -
this question has answer here:
i running pdo query on mysql database , error saying there invalid argument supplied foreach. on frontend, pass string $questiontable , integer $questionid.
what doing wrong?
$query = $this->dbconnection->query("select * ('$questiontable') id = ('$questionid')"); foreach ($query $row) { echo $row; };
is because of shouldn't put '' query? mean: $query = $this->dbconnection->query("select * ($questiontable) id = ($questionid)");
Comments
Post a Comment