}
if (!$stmt->execute()) {
exit("Execute failed: (" . $stmt->errno . ") " . $stmt->error);
}
$stmt->store_result();
if ($stmt->num_rows == 0 || $stmt->num_rows >= 2) {
exit("Error: id not found or multiple result found");
}
$stmt->bind_result($userid, $lastname, $firstname, $middlename, $suffix, $title, $department, $phone, $email, $photoImageURL, $keywordImageURL, $socialKeywordURL, $description);
$stmt->fetch();
$registered = 1;
} else {
if (isset($name)) {
$bind_param_last_name = $parser->getLast();
$bind_param_first_name = $parser->getFirst();
$bind_param_middle_name = $parser->getMiddle();
$bind_param_suffix = $parser->getSuffix();
if (!$stmt->bind_param("ssss", $bind_param_last_name, $bind_param_first_name, $bind_param_middle_name, $bind_param_suffix)) {
exit("Binding parameters failed: (" . $stmt->errno . ")" . $stmt->error);
}
if (!$stmt->execute()) {
exit("Execute failed: (" . $stmt->errno . ") " . $stmt->error);
}
$stmt->store_result();
if ($stmt->num_rows == 1) {
$stmt->bind_result($theid, $lastname, $firstname, $middlename, $suffix, $title, $department, $phone, $email, $photoImageURL, $keywordImageURL, $socialKeywordURL, $description);
$stmt->fetch();
$registered = 1;
} else {
if ($stmt->num_rows > 1) {
exit("Bad luck: Multiple records match");