Sure so here's the methods that do that:
public function processRequest(){
if($this->isEmailAvailable()){
$this->submitInviteRequest();
}
}
public function submitInviteRequest(){
//create new instance of the DB class and connect to DB
$condb = new DBCON();
$condb->startcon();
$req_query = mysql_query("INSERT INTO my_table (requestDate, email, city) VALUES('$this->requestDate', '" . mysql_real_escape_string($this->email) . "', '" . mysql_real_escape_string($this->city) . "')");
if($req_query){
echo "<div class=\"message_container\">";
echo "<div class=\"message_top\"></div>";
echo "<div class=\"message_mid\">";
echo "<h1>Success</h1>";
echo "<p>You have requested an invite!</p>";
echo "</div>";
echo "<div class=\"message_bottom\"></div>";
echo "</div>";
}
else{
$this->errors[] = '- Sorry, your invite request has not been sent!';
}
}
Can you post the code which calls for the email validation function and then inserts the record into the table ?
From the output you have posted above, it is obvious that there is already a record with that email in the table and hence the function mysql_num_rows($result) returns the value 1, thereby giving you the error message 'Whoa there! You already requested an invite!'