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
Post a Comment