I am using PDO to place an archive (mysql and php)
$stmt->bindParam(':field1', $field1, PDO::PARAM_STR); $stmt->bindParam(':field2', $field2, PDO::PARAM_STR); $stmt->execute();
It is possible to method to determine if it placed effectively, for instance when the record wasn't placed since it would be a duplicate?
Edit: obviously I'm able to consider the database, however i mean programmatic feedback.
Try searching in the return worth of [cde], that is
PDOStatement->execute() on success, and
PDOStatement->errorCode() on failure.
You can examine if the statement performed effectively as others have stated. You may also use
execute to obtain the quantity of rows impacted by a question:
PDOStatement::rowCount() returns the quantity of rows impacted by the final Remove, Place, or UPDATE statement performed through the corresponding PDOStatement object.
When the last SQL statement performed by the connected PDOStatement would be a Choose statement, some databases may return the amount of rows came back by that statement. However, this behavior isn't guaranteed for those databases and cannot be depended on for portable programs.