Jump to content

Autocommit acting crazy !!


d.shankar

Recommended Posts

Hi all .. the autocommit feature is driving me crazy

 

I have the set the autocommit feature to off , when i run this query it still truncates my table and commits it.

The below is the code can someone help me ?

 

<?php

$mysqli=new mysqli('localhost','username','password','dbname');
if(mysqli_connect_errno()){
    trigger_error('Error connecting to host. '.$mysqli->error,E_USER_ERROR);
}


$mysqli->autocommit(FALSE);

$mysqli->query("TRUNCATE table testing");



?>

 

Please dont bring on commit and rollback here , since the basic feature does not seem to work.

 

Link to comment
https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/
Share on other sites

I tried even this.. still no use

 

<?php

$mysqli=new mysqli('localhost','root','','test');
if(mysqli_connect_errno()){
    trigger_error('Error connecting to host. '.$mysqli->error,E_USER_ERROR);
}

$mysqli->autocommit(FALSE);
$mysqli->query("TRUNCATE table testing");
$mysqli->rollback();
$mysqli->close();

?>

 

Still the table gets truncated  ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.