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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -