设置
- CakePHP 2.3.5
- PostgreSQL 8.3
- 阿帕奇 2.2
- PHP 5.3.8
- Windows 7 旗舰版 x64
问题
当我两次执行此查询时,返回相同的值?
$sql = "select nextval('auth_num_seq') as nextval";
$nextval = $this->query($sql);
return $nextval[0][0]['nextval'];
为什么?
我也试了,还是不行?
$sql = "select setval('auth_num_seq', nextval('auth_num_seq') + 1, false)";
$setval = $this->query($sql);
$sql = "select nextval('auth_num_seq') as nextval";
$nextval = $this->query($sql);
return $nextval[0][0]['nextval'];