php - how to detect error in ajax file? -



php - how to detect error in ajax file? -

i utilize ajax saving value in db, problem appear in kind of work it's hard understand error because doesn't show error usual php file. how can error?

php file handle ajax request:

if(isset($_post['present'])){ $user_id=(int)$_post['user_id']; $date_id=(int)$_post['date_id']; $attendance_id=(int)$_post['attendance_id']; $attendance=new attendance(); $attendance->id=$attendance_id; $attendance->user_id=$user_id; $attendance->date_id=$date_id; $present_ok=$attendance->save(); echo $present_ok; }

if it's ok should homecoming true, , info should saved on db when alert data, there nil show , nil changes in db.

php ajax

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -