commit is used to make the changes permanent for databases that support this function. On MySQL, transactions are currently not supported, so the commit function does nothing. Once MySQL gets transaction capability, this function will most likely be updated to work with the MySQL DBD.
$return_code = $query_handle->commit;
The above preceding example attempts to commit the most recent changes to the database. If there is a problem, an error code will be retuned and stored in $return_code.
Also, commit works only when Autocommit is turned off. Autocommit is a flag used in the connect statement on databases that support it. Autocommit will automatically commit changes as they occur if it is enabled.