db/postgresql.php: (virtually identical for other databases)
<?
class query {
var $result;
var $row;
var $curr_row;
function query(&$db, $query="") {
// Constructor of the query object.
// executes the query, notifies the db object of the query result to clean
// up later
GLOBAL $modification_file;
if($query!=""){
if (!empty($this->result)) {
$this->free(); // query not called as constructor therefore there may
// be something to clean up.
}
$this->result=@pg_Exec($db->connect_id, $query);
If you have an efficient way of tracking the freshness of your
data, implementing proper Last-Modified/If-Modified-Since behaviour
for PHP applications is very simple. It has clear benefits for both
server and client side, and usually no drawbacks. Considering that, it is
surprising how rarely it seems to be used by PHP authors.