Transaction in PHP Mysql

This is how easily you can implement tractions in mysqli and PHP. $link = mysqli_connect(‘localhost’,’root’,”,’test’); // Check connection if (mysqli_connect_errno()) { die(‘error’); } mysqli_autocommit($link, FALSE); //disable autocommit $query=”insert into tb1 (username,pwd) values(‘pp’,’sdsd’)”; $queryres=mysqli_query($link, $query); if(!$queryres) { echo “error first query”;…