diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-11-29 12:25:04 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-11-29 12:25:04 +0000 |
commit | f0b14e59eec46323eb78af1872955fa8e086f507 (patch) | |
tree | 6a627e1bb3b52105130977a9224c90783827a5a2 | |
parent | 0f16e19dcd09f40d1f3d172dceb73453b525bde8 (diff) | |
download | forums-f0b14e59eec46323eb78af1872955fa8e086f507.tar forums-f0b14e59eec46323eb78af1872955fa8e086f507.tar.gz forums-f0b14e59eec46323eb78af1872955fa8e086f507.tar.bz2 forums-f0b14e59eec46323eb78af1872955fa8e086f507.tar.xz forums-f0b14e59eec46323eb78af1872955fa8e086f507.zip |
Fix for insert_id problem
git-svn-id: file:///svn/phpbb/trunk@1476 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/db/postgres7.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/phpBB/db/postgres7.php b/phpBB/db/postgres7.php index 6586869510..33b7f6809f 100644 --- a/phpBB/db/postgres7.php +++ b/phpBB/db/postgres7.php @@ -386,11 +386,17 @@ class sql_db } if($query_id && $this->last_query_text[$query_id] != "") { - if( eregi("^(INSERT{1}|^INSERT INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?", $this->last_query_text[$query_id], $tablename)) + + if( preg_match("/^INSERT[ ]+INTO[ ]+([a-z0-9\_\-]+)/is", $this->last_query_text[$query_id], $tablename) ) { $query = "SELECT last_value - FROM ".$tablename[2]."_id_seq"; + FROM " . $tablename[1] . "_id_seq"; $temp_q_id = @pg_exec($this->db_connect_id, $query); + if( !$temp_q_id ) + { + return false; + } + $temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC); if($temp_result) { |