roopesh
roopesh

Reputation: 33

mysql_query("START TRANSACTION")- Lock wait timeout exceeded; try restarting transaction in Codeigniter Mysql

I used mysql_query("START TRANSACTION"); in my code. does it causes this error?

Lock wait timeout exceeded; try restarting transaction in codeigniter mysql on update query.

I tried to change innodb_lock_wait_timeout to 100 on phpmyadmin, which is 50 now but it gives np previlage error and the value remains 50. Is there a way to solve the issue in my code. i dont know what i do wrong on code

Is there a way to use mysql_query("START TRANSACTION") in codeigniter

Upvotes: 1

Views: 416

Answers (1)

PrakashG
PrakashG

Reputation: 1642

Transactions are managed in CI as below:

$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');
$this->db->trans_complete();

You can refer this official link of documentation.

Upvotes: 1

Related Questions