Welcome Guest, Not a member yet? Register   Sign In
confirming successful update
#1

[eluser]Fenix[/eluser]
is there an easy way to check if a query has run successfully?
i'd like the update fucntions in my model to return true/false if they did/didn't succeed.
is this even necessary?
any ideas?

thanks
#2

[eluser]freshface[/eluser]
$response = $this->db-> ....

if($response ...
#3

[eluser]OES[/eluser]
In Model just place your query in an if like.


Model
Code:
if(!$this->db->update('table_name', $data)):
  return FALSE;
endif;

Controller
Code:
if(!$this->model_name->update_function($data)):
  // it failed
else:
  // It passed do something else.
endif;

Hope this helps

Good Luck




Theme © iAndrew 2016 - Forum software by © MyBB