MySql commit and rollback using php

First crate table using InnoDB storage engine of MySql.

CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;

<?php
$link = mysqli_connect("localhost", "root", "", "transaction");

/* check connection */
if (!$link) {
echo "Connect failed: ".mysqli_connect_error();
exit();
}

// set autocommit to off //
mysqli_autocommit($link, FALSE);

// Insert some values //
mysqli_query($link, "INSERT INTO users VALUES ('', 'Avi')");
mysqli_query($link, "INSERT INTO users VALUES ('', 'Sourav')");

// commit transaction //
$comm = mysqli_rollback($link);
$comm = mysqli_commit($link);
if (!$comm) {
echo "Transaction commit failed";
exit();
} else {
echo "Transaction committed";
}

// close connection //
mysqli_close($link);
?>