Changeset 198

Show
Ignore:
Timestamp:
02/12/06 13:55:56 (2 years ago)
Author:
dez
Message:

As of PostgreSQL 8.1, the OID field is no longer present by default. This means that pg_last_oid() no longer works. This update works around that, preventing the errors that appeared when posting new entries.
There may be other uses of db_last that I have not noticed. Therefore the function still exists, but just displays an error.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • admin.lib.php

    r193 r198  
    255255                        }  
    256256                        else { 
    257                                 $row = db_last($sql, "entries"); 
     257                                // $row = db_last($sql, "entries"); 
     258                                $result = db_query("SELECT * FROM entries WHERE shortsubject='".$shortsubject."'"); 
     259                                $row = db_getrow($result, 0); 
    258260                                $this->blog->printEntry($row,false,false); 
    259261                        } 
  • database.lib.php

    r162 r198  
    6969        function db_last($lastres, $table) 
    7070        { 
    71                 $oid = pg_last_oid($lastres); 
    72                 $res = db_query("select * from {$table} where oid=$oid"); 
    73                 return @db_getrow($res); 
     71        echo "Error - db_last no longer works"; 
     72// We can't do this any more - postgres 8 doesn't support it 
     73//              $oid = pg_last_oid($lastres); 
     74//              $res = db_query("select * from {$table} where oid=$oid"); 
     75//              return @db_getrow($res); 
    7476        } 
    7577        function db_close()