mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2026-09-03 10:21:38 -04:00
Tests to find out if a Patron's name already exists in the database.
If so, this error is produced: Your name already exists, please choose a different middle initial.
This commit is contained in:
@@ -8,6 +8,22 @@ $email_list_connector_password = EMAIL_LIST_CONNECTOR_PASSWORD;
|
||||
$ssl_certificate = SSL_CERTIFICATE;
|
||||
|
||||
|
||||
// test whether patron's name already exists
|
||||
if (isset($_POST['test_name'])) {
|
||||
|
||||
$query = 'SELECT first_name, middle_initial, last_name FROM contacts WHERE ' .
|
||||
'first_name="' . $_POST['first_name'] . '" AND middle_initial="' . $_POST['middle_initial'] .
|
||||
'" AND last_name="' . $_POST['last_name'] . '";';
|
||||
$sql = mysql_query($query, $YBDB) or die(mysql_error());
|
||||
$result = mysql_fetch_assoc($sql);
|
||||
if ( is_array($result) ) {
|
||||
echo 1;
|
||||
} else {
|
||||
echo 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// update waiver
|
||||
if( isset($_POST['waiver']) ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user