prepare('DELETE FROM network_addresses WHERE network_id=:id'); if (!$stmt) { throw new Exception('While preparing message statement: '.$db->lastErrorMsg()); } if (!$stmt->bindValue(':id', intval($_POST['id']), SQLITE3_INTEGER)) { throw new Exception('While binding id to message statement: '.$db->lastErrorMsg()); } if (!$stmt->execute()) { throw new Exception('While executing message statement: '.$db->lastErrorMsg()); } $stmt = $db->prepare('DELETE FROM network WHERE id=:id'); if (!$stmt) { throw new Exception('While preparing message statement: '.$db->lastErrorMsg()); } if (!$stmt->bindValue(':id', intval($_POST['id']), SQLITE3_INTEGER)) { throw new Exception('While binding id to message statement: '.$db->lastErrorMsg()); } if (!$stmt->execute()) { throw new Exception('While executing message statement: '.$db->lastErrorMsg()); } $reload = true; JSON_success(); } catch (\Exception $ex) { JSON_error($ex->getMessage()); } } else { log_and_die('Requested action not supported!'); }