Thanks for the prompt response.
I am using the downloaded file and it is not working. I am running window 7 (64 bit) because of which my debugger is not working as expected. I cannot get breakpoints. I tried doing var_dump, but it is not reaching to that line. The var_dump is not being executed.
public function addRecord() {
// Verify the fields
if ($this->_verifyInput()) {
// Get the Database connection
$connection = Database::getConnection();
// Prepare the data
$query = "INSERT INTO contacts(first_name, last_name, position, email, phone)
VALUES ('" . Database::prep($this->first_name) . "',
'" . Database::prep($this->last_name) . "',
'" . Database::prep($this->position) . "',
'" . Database::prep($this->email) . "',
'" . Database::prep($this->phone) . "')";
// Run the MySQL statement
if ($connection->query($query)) {
$return = array('', 'Contact Record successfully added.');
// add success message
return $return;
} else {
// send fail message and return to contactmaint
$return = array('contactmaint', 'No Contact Record Added. Unable to create record.');
return $return;
}
} else {
// send fail message and return to contactmaint
$return = array('contactmaint', 'No Contact Record Added. Missing required information.');
return $return;
}
}
Since, I am getting the error listed in the nested if statement, I am assuming that the first IF statement <if ($this->_verifyInput())> is executed. However, var_dump() is not being executed within the IF statement.
|