How can i return a boolean from the execute function if it's correct or not
I need to validate the queries, either with a select, update, delete and insert.
I need you to return me if it was done correctly or not. I am calling from a function and according to what I answer, I must do one or the other action.
Something like this:
if ($stmt->execute()) {
echo 1; // it worked
} else {
echo 0; // it didn't
}
If I do it this way, it always returns 0
Thank you very much!