Array display "Array" text |
[eluser]clintonbeattie[/eluser]
Hi, I have created a controller, model and view and get teh correct number of entries from my database displayed in my view, but that all say "Array". I'm sure this is simple but can someone please help? Thanks. Code: class Welcome extends Controller { Code: class MPosts extends Model { Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Code: <?php
[eluser]brianw1975[/eluser]
in your controller do a var_dump on $data['navlist'] to verify the data i bet you have to do something like echo anchor("welcome/blog/$id",$intro['name']);
[eluser]fesweb[/eluser]
More likely, it will be: Code: foreach ($navlist as $row){
[eluser]fesweb[/eluser]
Also, dBug is a really great debugging tool when it comes to dealing with arrays and objects. Just save it as dbug_helper, load it like any other helper and when there is an array to investigate use it. Code: // load it in your controller |
Welcome Guest, Not a member yet? Register Sign In |