Can we lock tables while executing a query in Zend-Db
问题 I am talking about doing something like this: LOCK TABLE page WRITE; SELECT * FROM page WHERE col = 'value'; INSERT INTO page(col1, col2) VALUES('val1', val2); UNLOCK TABLES; 回答1: I don't see an actual Zend DB method to lock tables, but maybe just do this: //Lock Table $sql = "LOCK TABLE page WRITE"; $db->fetchRow($sql); //Get your data $sql = "SELECT * FROM page WHERE col='value'"; $result = $db->fetchAll($sql); //Make the insert $data = array( 'col1' => 'val1', 'col2' => 'val2' ); $db-