Having little trouble getting data from database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Having little trouble getting data from database (/showthread.php?tid=12634) |
Having little trouble getting data from database - El Forum - 10-26-2008 [eluser]faxtion[/eluser] Got the following code but does not display anything in view, neither does it give me and error, any help appreciated Code: Controller Code: Model Code: View Having little trouble getting data from database - El Forum - 10-26-2008 [eluser]OES[/eluser] It does not look like your are passing back an array. Try this. Code: <?php Regards Having little trouble getting data from database - El Forum - 10-26-2008 [eluser]Randy Casburn[/eluser] Hi, You've passed you data to your view as: Code: $data['parts'] = $this->Parts_model->get_parts(); and you are referencing your data in your view as: Code: <h4><?=$part['postid']?></h4> part vs. parts I hate it when I do that! Hope that helps, Randy Having little trouble getting data from database - El Forum - 10-26-2008 [eluser]faxtion[/eluser] Tried both solutions but still not displaying any data but I get three lots of html tags where my data should be, Having little trouble getting data from database - El Forum - 10-26-2008 [eluser]Randy Casburn[/eluser] Yea - I just noticed I was wrong...I looked right past this... Code: <?php foreach($parts as $part):?> Sorry about that. I hope I didn't break you worse. Please ignore my previous post. |