Php array to string conversion error with SLIM framework -


i used php framework pass variable $data html page echo in loop here index.php :

$result=$db->query('select * test'); while ($row=$result->fetch(pdo::fetch_assoc)) {   $data[]=$row; } $app->render('form.php',$data)); 

and display form.php

foreach ($this->$data $user) {   echo $user['id']. '-' . $user['name'].'<br>' } 

i array string conversion error, idea ? tired var_dump($this->$data); instead of foreach loop , same error : array string conversion

enter image description here

maybe $this->data instead of $this->$data

foreach ($this->$data $user) {   echo $user['id']. '-' . $user['name'].'<br>' } 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -