!is_null($entries) && $entries !== '') as $e) { // build some type of Prepared Statement to protect from SQL Injection $input = "INSERT INTO tb_tindakan (id_pasien,tindakan,masalah,perawat_spv,perawat_ppa,ruang) VALUES ('$id_pasien','$e','belum','$perawat_spv','$perawat_ppa','$ruang')"; $query_input = mysqli_query($open, $input); if ($query_input) { echo json_encode(array("statusCode" => 200)); //Jika Sukses } else { echo json_encode(array("statusCode" => 201)); //Jika Gagal } } } } //Tutup koneksi engine MySQL mysqli_close($open);