Handle errors better when updating row

This commit is contained in:
git 2025-06-21 18:36:17 +01:00
parent f8fb62c77b
commit 0224ccd4cb

View File

@ -197,7 +197,11 @@ function updateDatabaseRow($tableName, $originalRow, $newRowValue) {
} }
$sql_instruction = "UPDATE $tableName SET " . implode(", ", $setStatements) . " WHERE " . implode(" AND ", $whereStatements); $sql_instruction = "UPDATE $tableName SET " . implode(", ", $setStatements) . " WHERE " . implode(" AND ", $whereStatements);
sql($sql_instruction); try {sql($sql_instruction);}
catch (Exception $e) {
echo "ERROR: while trying $sql_instruction\n\n";print_r($e->getMessage());
}
} }
function updateTriggerError($tableName, $error) { function updateTriggerError($tableName, $error) {