![]() |
Model does weird(solved) - 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: Model does weird(solved) (/showthread.php?tid=9428) |
Model does weird(solved) - El Forum - 06-25-2008 [eluser]Jesse2303[/eluser] PROBLEM SOLVED Hi all I've forgooten to make my models and now when I'm trying to make them I get stuck every time. I want to show the last 3 titels of the news, links, pictures. Can you look @ my script please ? Class: Main, Function dashboard() Code: function dashboard() { Code: class Show extends Model { My output script Code: <?php foreach($query->result() as $row):?> Fatal Error: Call to a member function_result() on a non-object in ... on line 31 Line 31 in that file: Code: <?php foreach($query->result() as $row):?> Model does weird(solved) - El Forum - 06-25-2008 [eluser]Armchair Samurai[/eluser] Well, you're not actually returning anything from your model functions - you might want to start there. What is the error you're getting? It wasn't clear from your initial post. Model does weird(solved) - El Forum - 06-25-2008 [eluser]Yash[/eluser] You can't directly use model like this.or I've not tried ![]() anyways MY_Model.php Code: <?php or Code: class Post extends Model { Model does weird(solved) - El Forum - 06-25-2008 [eluser]Jesse2303[/eluser] [quote author="Yash" date="1214397605"]You can't directly use model like this.or I've not tried ![]() anyways MY_Model.php Code: <?php or Code: class Post extends Model { I dont get that :-S [quote author="Armchair Samurai" date="1214397360"]Well, you're not actually returning anything from your model functions - you might want to start there. What is the error you're getting? It wasn't clear from your initial post.[/quote] Fatal Error: Call to a member function_result() on a non-object in ... on line 31 Line 31 in that file: Code: <?php foreach($query->result() as $row):?> I've tried this to but it doesn't work: Code: function get_nieuws() { |