![]() |
Error Counting Database Data - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Error Counting Database Data (/showthread.php?tid=64135) |
Error Counting Database Data - equa24 - 01-19-2016 Hello, I'm pretty new to codeigniter and I've been struggling very much about this month just to make this thing work. Currently I'm creating a web app, the purpose is monitoring some data and count all the data at specific date. What I'm trying to do was just counting all the data in a table. So here's my approach: Model: PHP Code: <? class Dash_model extends CI_Model { Controller: PHP Code: <?php View: PHP Code: <thead> Code: An uncaught Exception was encountered I hope someone can help me, I've been learning Codeigniter for weeks and I still don't get it... Thank you very much... RE: Error Counting Database Data - InsiteFX - 01-19-2016 In your model above take the semi-colon off the end of the if statement. RE: Error Counting Database Data - pdthinh - 01-19-2016 (01-19-2016, 03:34 AM)equa24 Wrote: Model: Your model should start with <?php , let's give it a try. RE: Error Counting Database Data - equa24 - 01-19-2016 Hey, thanks a lot it works now... Oh my god... I'm laughing right now... ![]() It solved the MVC problem, but I still can't get the query run... I tried it with different approach by now: MODEL: PHP Code: <?php class Dash_model extends CI_Model { CONTROLLER: PHP Code: <?php VIEW: (I'm using a Bootstrap HTML5 Template's table, so I put the count result in one of the <td>) PHP Code: <thead> Still no count result showing... The error I got was: PHP Code: A PHP Error was encountered Thank you for your help, guys... I really appreciate it... RE: Error Counting Database Data - pdthinh - 01-20-2016 (01-19-2016, 07:02 PM)equa24 Wrote: The error message shows that Welcome controller was called, not your Dash_control. May you have a mistake? |