public static function validateId($id) { if (is_null($id) || !preg_match("/^[0-9]+\$/", $id)) { throw new Exception("Data has been tempered. Aborting process."); } if (!StudentFetcher::exists(StudentFetcher::DB_COLUMN_ID, $id, PDO::PARAM_INT)) { // TODO: sent email to developer relevant to this error. throw new Exception("Either something went wrong with a database query, or you're trying to hack this app. In either case, the developers were just notified about this."); } }