[eluser]someone
[/eluser]
Right now I was trying my script if all works like it should, but I found a error.
Model:
Code:
public function updatedata($table, $nameid, $idnum, $data)
{
if ($this->db->where($nameid, $idnum)->update($table, $data))
{
return $this->db->affected_rows();
}
}
If I change input data it works good, but if I leave as before - without changing, I get error, because there is not affected rows. What's the best replacement for this?
It will be this good?
Code:
public function updatedata($table, $nameid, $idnum, $data)
{
if ($this->db->where($nameid, $idnum)->update($table, $data))
{
return TRUE;
}
}