mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Fix for insert_id problem
git-svn-id: file:///svn/phpbb/trunk@1476 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
0f16e19dcd
commit
f0b14e59ee
1 changed files with 8 additions and 2 deletions
|
@ -386,11 +386,17 @@ class sql_db
|
||||||
}
|
}
|
||||||
if($query_id && $this->last_query_text[$query_id] != "")
|
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
|
$query = "SELECT last_value
|
||||||
FROM ".$tablename[2]."_id_seq";
|
FROM " . $tablename[1] . "_id_seq";
|
||||||
$temp_q_id = @pg_exec($this->db_connect_id, $query);
|
$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);
|
$temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC);
|
||||||
if($temp_result)
|
if($temp_result)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue