Welcome Guest, Not a member yet? Register   Sign In
Best way for checking true result
#13

[eluser]someone Smile[/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;
}
}


Messages In This Thread
Best way for checking true result - by El Forum - 05-07-2012, 09:02 AM
Best way for checking true result - by El Forum - 05-07-2012, 12:17 PM
Best way for checking true result - by El Forum - 05-07-2012, 04:24 PM
Best way for checking true result - by El Forum - 05-07-2012, 08:24 PM
Best way for checking true result - by El Forum - 05-08-2012, 06:14 AM
Best way for checking true result - by El Forum - 05-08-2012, 06:18 AM
Best way for checking true result - by El Forum - 05-08-2012, 06:51 AM
Best way for checking true result - by El Forum - 05-08-2012, 08:56 AM
Best way for checking true result - by El Forum - 05-08-2012, 11:35 AM
Best way for checking true result - by El Forum - 05-27-2012, 10:14 AM
Best way for checking true result - by El Forum - 05-27-2012, 10:28 AM
Best way for checking true result - by El Forum - 07-03-2012, 12:05 PM
Best way for checking true result - by El Forum - 07-26-2012, 11:22 AM
Best way for checking true result - by El Forum - 07-26-2012, 11:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB