$db = new mysqli('localhost', 'username', 'password', 'database_name'); // Start a transaction $db->begin_transaction(); // Make changes to the database // Commit the changes as a transaction $db->commit();In this example, we connect to a MySQL database using the mysqli class. We then begin a transaction using the begin_transaction method. We then make changes to the database, and when we are ready to commit the changes, we call the commit method. The commit_transaction function is part of the MySQLi extension in PHP, which is a package library for interacting with MySQL databases.