Closed BurakBoz closed 3 years ago
Hi,
$db->error();
this method returns an array and need some extra checks, we really need a simple boolean method to check if last query succeeded or failed. Please consider this feature.
An ugly error checking example:
$db->update("table", ["a" => "b"], ["c" => "d"]); if (!is_null($db->error()[1])) { echo "Error!"; } else { echo "Updated!"; }
A beautiful example:
$db->update("table", ["a" => "b"], ["c" => "d"]); if($db->hasError()) { echo "Error!"; } else { echo "Updated!"; }
We will have this feature on next v2.0 discussed here: https://github.com/catfan/Medoo/discussions/946
You can check the error simply by this:
if ($database->error) { echo "having error"; }
Hi,
$db->error();
this method returns an array and need some extra checks, we really need a simple boolean method to check if last query succeeded or failed. Please consider this feature.
An ugly error checking example:
A beautiful example: