d.shankar Posted July 29, 2008 Share Posted July 29, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/ Share on other sites More sharing options...
ignace Posted July 29, 2008 Share Posted July 29, 2008 what is your db table type? autocommit() does not work with MyISAM or ISAM, you probably know this if you read the manual Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/#findComment-602652 Share on other sites More sharing options...
d.shankar Posted July 29, 2008 Author Share Posted July 29, 2008 Please i am not that much n00b. ., I know that it wont work with MyISAM ..etc Mine is InnoDB. Anyway thank you for reply. Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/#findComment-602749 Share on other sites More sharing options...
d.shankar Posted July 29, 2008 Author Share Posted July 29, 2008 Bump1 Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/#findComment-602858 Share on other sites More sharing options...
d.shankar Posted July 29, 2008 Author Share Posted July 29, 2008 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 ??? Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/#findComment-602903 Share on other sites More sharing options...
d.shankar Posted July 29, 2008 Author Share Posted July 29, 2008 Bump2 Any experienced mods worked with mysqli ?? Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/#findComment-602951 Share on other sites More sharing options...
corbin Posted July 29, 2008 Share Posted July 29, 2008 Is TRUNCATE TABLE supported in transactions? Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/#findComment-602995 Share on other sites More sharing options...
d.shankar Posted July 30, 2008 Author Share Posted July 30, 2008 It should support. I heard that only CREATE TABLE & CREATE DATABASE are not supported. Quote Link to comment https://forums.phpfreaks.com/topic/117139-autocommit-acting-crazy/#findComment-603339 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.