mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Next ID didn't need the + 1
git-svn-id: file:///svn/phpbb/trunk@324 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
48312a6566
commit
2a3abfe286
1 changed files with 3 additions and 3 deletions
|
@ -71,7 +71,7 @@ class sql_db
|
||||||
{
|
{
|
||||||
$make_connect = $this->connect_string;
|
$make_connect = $this->connect_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->persistency = $persistency;
|
$this->persistency = $persistency;
|
||||||
if($this->persistency)
|
if($this->persistency)
|
||||||
{
|
{
|
||||||
|
@ -340,13 +340,13 @@ class sql_db
|
||||||
{
|
{
|
||||||
if( eregi("^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?", $this->last_query_text[$query_id], $tablename))
|
if( eregi("^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?", $this->last_query_text[$query_id], $tablename))
|
||||||
{
|
{
|
||||||
$query = "SELECT last_value
|
$query = "SELECT last_value
|
||||||
FROM ".$tablename[2]."_id_seq";
|
FROM ".$tablename[2]."_id_seq";
|
||||||
$temp_q_id = @pg_exec($this->db_connect_id, $query);
|
$temp_q_id = @pg_exec($this->db_connect_id, $query);
|
||||||
$temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC);
|
$temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC);
|
||||||
if($temp_result)
|
if($temp_result)
|
||||||
{
|
{
|
||||||
return $temp_result['last_value']+1;
|
return $temp_result['last_value'];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue