Friday, 15 July 2011

php - INNODB and mysql PDO driver lock in share mode -



php - INNODB and mysql PDO driver lock in share mode -

with innodb can add together query lock in share mode; other users can still read not update untill user editing finished.

my current pdo function in php looks like:

//$this->db pdo connection mysql innodb database. seek { $this->db->begintransaction(); $tmp = $this->db->prepare($query); $tmp->execute($arr); $this->last_id = $this->db->lastinsertid(); $this->db->commit(); homecoming $this->last_id; } catch(pdoexception $ex) { $this->db->rollback(); homecoming $ex->getmessage(); }

is there pdo driver function setting set in share mode? if how? things find have no answers them , documentation isn't clear either. or should add together query string?

you have create query mach mysql syntax , that's all, example:

select * parent name = 'jones' lock in share mode

just append lock in share mode query string.

php mysql pdo innodb

No comments:

Post a Comment