![]() |
Code Wont Run - 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: Code Wont Run (/showthread.php?tid=23929) |
Code Wont Run - El Forum - 10-26-2009 [eluser]hangbill[/eluser] Hi Need help please. Have sat two days trying to get this seemingly simple code to run but not happening. Will post my model, controller and view; if you can see an error in the code please let me know. Thank you very much. url = Code: http://localhost/CodeIgniter1.7.2/topic model Code: <?php controller Code: <?php view Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" Code Wont Run - El Forum - 10-26-2009 [eluser]stormlead[/eluser] hey i suppose ou did no write $q = $this->db->get('tbltopic'); the $ is missing there. check it out it shud work. Code Wont Run - El Forum - 10-26-2009 [eluser]jedd[/eluser] I'm unfamiliar with the error 'not happening' - perhaps you could use more words to describe what happens. Controllers like a constructor, too. Unrelated to your problem - the manual indicates you should load models using their ucfirst() name (not just lower case as you've done here) and subsequently refer to them with their ucfirst() name too. Code Wont Run - El Forum - 10-26-2009 [eluser]markup2go[/eluser] Enable error reporting in your php.ini or use ini_set() to show errors while you're in development. I believe stormlead already answered your question however ![]() Code Wont Run - El Forum - 10-26-2009 [eluser]khagendra[/eluser] There is two mistaken you have done. 1. In model function, you forget to use $ sign. here is ur code Code: function get_records() { --> Correct it like this Code: function get_records() { 2. In the view file, the argument in foreach loop. here is ur code Code: <?php --> It should be like this Code: <?php Code Wont Run - El Forum - 10-26-2009 [eluser]hangbill[/eluser] Yes that's it, two errors. I just could not see them. About the result() error I guess I turned it into function, instead of a key from the $data array. Think I'm getting it slowly. Thanks very much for all the feedback. |