where('id', $id)->delete(); if ($affectedRows != 1) { throw new \RuntimeException("Unable to delete the account."); } $tables = [ 'hit_and_runs' => 'uid', 'claims' => 'uid', 'exam_users' => 'uid', 'exam_progress' => 'uid', ]; foreach ($tables as $table => $key) { \Nexus\Database\NexusDB::table($table)->where($key, $id)->delete(); } }); } catch (\Exception $exception) { stderr("Error", $exception->getMessage()); } stderr("Success", "The account ".htmlspecialchars($name)." was deleted.",false); } stdhead("Delete account"); ?>