![]() |
Basic M > C > V Problem - can't see where I am going wrong - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Basic M > C > V Problem - can't see where I am going wrong (/showthread.php?tid=10802) |
Basic M > C > V Problem - can't see where I am going wrong - El Forum - 08-13-2008 [eluser]Chad Crowell[/eluser] In my Model: Code: <?php In my Controller: Code: <?php In my View: Code: <body> When I didn't have the model involved, it worked just fine. When I move the foreach loop to the model, it outputs the questions. As is, I get the h1 Hello /h1 but nothing beyond that. Somehow I am doing something simple wrong. This always happens and I never get farther than my first query in CI before I quit and outsource the project... help! Basic M > C > V Problem - can't see where I am going wrong - El Forum - 08-13-2008 [eluser]eilrahc[/eluser] The only blatantly off-kilter thing I see at first glance is that "Information_model" should be all lowercase in your controller. If the model filename contains an uppercase 'I', try making that lowercase as well. I don't know if CI really cares, but that's the convention anyway. I understand the overall frustration of getting started, I'm in much the same boat. ![]() Basic M > C > V Problem - can't see where I am going wrong - El Forum - 08-13-2008 [eluser]erik.brannstrom[/eluser] Hi! If I'm not mistaken, the active records method result() returns an object. Try $row->question instead of $row['question'] in your view. Hope this helps! Best regards, Erik Basic M > C > V Problem - can't see where I am going wrong - El Forum - 08-13-2008 [eluser]Colin Williams[/eluser] Alternatively, you can return $query->result_array() from your model method. Basic M > C > V Problem - can't see where I am going wrong - El Forum - 08-13-2008 [eluser]Chad Crowell[/eluser] erik thanks, your solution was the one. You guys all rock! Let's hope page 2 goes better! |