mysqli transactions
<?php
// NOTE THAT begin_transaction() REQUIRES PHP 5.5+
$db = new mysqli('localhost', 'user', 'pass', 'db');
$db->begin_transaction();
$query = "UPDATE `nicl_students` SET `total` = 100 WHERE `id_students` = 127760";
$results = $db->query($query);
$query = "UPDATE `nicl_students` SET `total` = 200 WHERE `id_students` = 127760";
$results = $db->query($query);
$db->commit(); // This will end the first transaction
// query without transactions
$query = "UPDATE `nicl_students` SET `total` = 300 WHERE `id_students` = 127760";
$results = $db->query($query);
$db->begin_transaction();
$query = "UPDATE `nicl_students` SET `total` = 400 WHERE `id_students` = 127760";
$results = $db->query($query);
$db->commit(); // This will end the second transaction
?>