I have a simple form that inserts data into my sqlite database. It works just fine on my localhost, however, I am not getting the insert to work on my remote server. How do I get error messages if my execute() never happens or === false?
Here is my code:
if (isset($_POST["submit"])) {
$email = $_POST["Email"];
$name = $_POST["txt_Name"];
$agency = $_POST["sel_Agency"];
$subagency = $_POST["txt_SubAgency"];
$location = $_POST["txt_Location"];
$params = array(
':email' => $email,
':name' => $name,
':agency' => $agency,
':subagency' => $subagency,
':location' => $location
);
$stmt = $db->prepare($sql);
if ($stmt->execute($params) === FALSE) {
//HOW TO SHOW ERROR CODE HERE
}
}
I tried a try-catch, but didn't get anything. However, if I echo "ERROR" for example, I get the echo ERROR on screen.... I know it isn't working also, since the db has no new rows.
Any help would be appreciated. Thanks!