Sorry Sir , Why When I use mysqli_begin_transaction,mysqli_commit,mysqli_rollback isn't working in function insert phpgrid
This exp Syntax not working:
$conn = mysqli_connect(PHPGRID_DBHOST, PHPGRID_DBUSER, PHPGRID_DBPASS, PHPGRID_DBNAME);
$error = 0;
mysqli_begin_transaction($conn);
$sql_first =
"
INSERT
(right syntax)
";
$rslt_first = mysqli_query($sql_first);
if(!$rslt_first)
{
$error++;
}
$sql_second =
"
UPDATE
(wrong syntax)
";
$rslt_second = mysqli_query($sql_second);
if(!$rslt_second)
{
$error++;
}
if($error == 0) /*– <<<<— Use This in the end your sql transaction –*/
{
mysqli_commit($conn);
}else
{mysqli_rollback($conn);
}
Please Your Solution Sir
I guess it's more linked to php / mysql query and not php grid api.
You can post it on stackoverflow:
Similar discussion here:
http://stackoverflow.com/questions/17649926/how-does-mysqlicommit-mysqlirollback-work