I've spent some time searching on the Internet and playing around with my code but I still can't figure out why I am getting this error message. Here is an excerpt from my code:
} else {
if (!empty($errors) && nexus_error($nexus)==false) {
$message = "There were" . count($errors) . " errors in the form.";
} if (!empty($errors) && nexus_error($nexus)) {
$message = "There were" . count($errors) . " errors in the form.";
$message .= "A user with the username" . $nexus . " already exists in the database.";
} if (empty($errors) && nexus_error($nexus)) { //***this line causes the error
$message = "A user with the username" . $nexus . " already exists in the database.";
}
}
The function nexus_error, by the way, is defined below:
function nexus_error($sel_nexus) {
global $connection;
$query = "SELECT * FROM person WHERE nexus={$sel_nexus}";
$result_set = mysql_query($query, $connection);
confirm_query($result_set);
if (count(mysql_fetch_array($result_set)) != 0) {
return true; // bad
} else {
return false;
}
}
Any help would be great. Thanks for your time :)