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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -