x editable and codeigniter: display error message if data not updated into db x editable and codeigniter: display error message if data not updated into db codeigniter codeigniter

x editable and codeigniter: display error message if data not updated into db


if you are processing the editable submission using ajax you need to set:

echo 1; //if model returns true

and

echo 0; //if model returns false    

in the controller.

Then in the ajax reponse you need to check in the script:

(Consider the response variable is response)

if(response==1){  alert('Update Success.');}else{  alert('Update Failure !')}


This would be easier if you provided us with a code sample.

If you're working with ActiveRecord, you can always use:

if($this->db->affected_rows() > 0){   return true;}else{   return false;}