Home  >  Article  >  Backend Development  >  cakephp运用事务

cakephp运用事务

WBOY
WBOYOriginal
2016-06-13 13:14:581085browse

cakephp使用事务

begin;

INSERT INTO `dev_dgc`.`user_datas` (`id`, `game_id`, `created`) VALUES (NULL,? '1', '2');

INSERT INTO `dev_dgc`.`user_datas` (`id`, `game_id`, `created`) VALUES (NULL,? '1', '2');

INSERT INTO `dev_dgc`.`user_datas` (`id`, `game_id`, `created`) VALUES (NULL,? '1', '2');

commit;

?

?

?

$this->query('begin');
// 保存新增用户信息
if(!$this->save($data)) {
return false;
}
if(!$PlayerDevice->bindPlayerDevice($data))
{
return false;
}
$this->query('commit');
?

?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn