• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Model does weird(solved)

#4
[eluser]Jesse2303[/eluser]
[quote author="Yash" date="1214397605"]You can't directly use model like this.or I've not tried Sad

anyways

MY_Model.php
Code:
<?php
class BaseModel extends Model {
    function __construct(){
        parent::__construct();
    }

        //Your code here
}
?>

class Post extends BaseModel {
   //Your code here
}

or
Code:
class Post extends Model {
  ststic function doit(){
    return '123';
  }
  
  function get_123(){
    return self::doit();
  }
}
thanx to Sam Dark for code[/quote]

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() {
        
        $get_nieuws     =     $this->db->query('SELECT * FROM nieuws ORDER BY datum DESC LIMIT 3');
        Return $get_nieuws->result();
        
    }


Messages In This Thread
Model does weird(solved) - by El Forum - 06-25-2008, 01:28 AM
Model does weird(solved) - by El Forum - 06-25-2008, 01:36 AM
Model does weird(solved) - by El Forum - 06-25-2008, 01:40 AM
Model does weird(solved) - by El Forum - 06-25-2008, 01:41 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.