I have table like this
These are the codes:
Controller :
View :
Why did I get error when I try to run those codes? This is the message error:
What may I do to fix that? Thank you
I have table like this
These are the codes:
Controller :
View :
Why did I get error when I try to run those codes? This is the message error:
What may I do to fix that? Thank you
The variable $faculty
is not an array of objects, but strings (is what the method column()
of the Query
class returns). Therefore, the foreach
gives you the value of the variable right away:
foreach($faculty as $key=>$data){
array_push($faculty_lessarr,
array('name'=>$data,
...