function query_count_occurrences_failure() { global $connection; $value = 22; $column = "email"; $table = "user"; assert(!query_count_occurrences($value, $column, $table)); }
function validate_email($email) { global $errors; //$email value in the "email" column of the "user" table if (query_count_occurrences($email, "email", "user")) { //if it occurs one or more times $errors['email_used'] = "The email address has been used, please use another email address."; } }