|
From: Paul S. O. <ps...@us...> - 2001-11-29 12:25:07
|
Update of /cvsroot/phpbb/phpBB2/db
In directory usw-pr-cvs1:/tmp/cvs-serv7896/db
Modified Files:
postgres7.php
Log Message:
Fix for insert_id problem
Index: postgres7.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/db/postgres7.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** postgres7.php 2001/09/07 16:58:45 1.13
--- postgres7.php 2001/11/29 12:25:04 1.14
***************
*** 387,395 ****
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))
{
$query = "SELECT last_value
! FROM ".$tablename[2]."_id_seq";
$temp_q_id = @pg_exec($this->db_connect_id, $query);
$temp_result = @pg_fetch_array($temp_q_id, 0, PGSQL_ASSOC);
if($temp_result)
--- 387,401 ----
if($query_id && $this->last_query_text[$query_id] != "")
{
!
! if( preg_match("/^INSERT[ ]+INTO[ ]+([a-z0-9\_\-]+)/is", $this->last_query_text[$query_id], $tablename) )
{
$query = "SELECT last_value
! 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)
|