fixed $this->table attribute access

This commit is contained in:
rtorralba 2015-04-23 17:04:57 +02:00
parent 5271ea5a1d
commit 6da49bb38b

View File

@ -44,17 +44,17 @@ snippet ci_model_complet
public function getRows()
{
return $this->db->get($table)->result();
return $this->db->get($this->table)->result();
}
public function getRow($id)
{
return $this->db->get_where($table, array('id', $id))->result();
return $this->db->get_where($this->table, array('id', $id))->result();
}
public function insert($data)
{
if($this->db->insert($table, $data))
if($this->db->insert($this->table, $data))
return true;
else
return false;
@ -62,7 +62,7 @@ snippet ci_model_complet
public function update($id, $data)
{
if($this->db->where('id', $id)->update($table, $data))
if($this->db->where('id', $id)->update($this->table, $data))
return true;
else
return false;