Welcome Guest, Not a member yet? Register   Sign In
Call to undefined method CI_DB_mysql_driver::row()

------- EDIT -----------
I am such an a$$ - I forgot:
after the AR call.

Sorry to waste your time!

------- EDIT ---------

Hi all,

Perhaps I am being a dumbass, but I'm getting this error:

Quote:Call to undefined method CI_DB_mysql_driver::row()

and this is the model:
class Portfolio extends Model {
        var $shop_id; // Contains the ID for the Whats in the Shop car.
        function Portfolio() {
        function getShop(){
            if (empty($this->shop_id)){
                $q = $this->db->select('p_id')->from('type_lkp')->where('t_id',3)->orderby('p_id', 'desc')->limit(1);
                $row = $q->row();
                $this->shop_id = $row->name;
            return $this->shop_id;
        function getShopCopy() {
            $q = $this->db->select('desc')->from('portfolio')->where('id', $this->getShop());
            $r = $q->row();
            return $r->desc;

The error is on this line: $row = $q->row();

I can't see what the problem is - am I doing something very stupid?

Thanks in advance,


Maybe is that way:

$row = $q->result()->row();

Hi Luisjose,

Thanks for the reply, what I actually did was prepared the SQL statement using ActiveRecord and then didn't actually *execute* the query to get the DB object.

Once you've got the db object, then you can extract the result.

I *was* being a dumba$$ afterall!


Theme © iAndrew 2016 - Forum software by © MyBB