Changeset 50 for www/database.php


Ignore:
Timestamp:
Feb 24, 2008, 2:07:52 PM (16 years ago)
Author:
george
Message:

Změněno: Odebrán proměnný podíl na zařízení sítě.
Změněno: Ceny tarifů změněny na pevné.
Změněno: Měsíční přehled nákladů a výnosů sítě.
Odebráno: Účtování spotřeby.
Upraveno: Systém zobrazení navigačního řádku.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/database.php

    r30 r50  
    1 <?
     1<?php
    22
    33// Extended database class
     
    77{
    88  var $Prefix = '';
     9  var $LastQuery = '';
    910 
    1011  function select($Table, $What = '*', $Condition = 1)
    1112  {
    12     $Query = "SELECT ".$What." FROM `".$this->Prefix.$Table."` WHERE ".$Condition;
    13     return($this->query($Query)); 
     13    $this->LastQuery = "SELECT ".$What." FROM `".$this->Prefix.$Table."` WHERE ".$Condition;
     14    return($this->query($this->LastQuery)); 
    1415  }
    1516
    1617  function delete($Table, $Condition)
    1718  {
    18     $this->query("DELETE FROM `".$this->Prefix.$Table."` WHERE ".$Condition); 
     19    $this->LastQuery = "DELETE FROM `".$this->Prefix.$Table."` WHERE ".$Condition;
     20    $this->query($this->LastQuery); 
    1921  }
    2022 
     
    2628    {
    2729      $Value = strtr($Value, '"', '\"');
    28       $Name .= ','.$Key;
     30      $Name .= ',`'.$Key.'`';
    2931            if($Value == 'NOW()') $Values .= ",".$Value;
    3032              else $Values .= ",'".$Value."'";
     
    3234    $Name = substr($Name, 1);
    3335    $Values = substr($Values, 1);
    34     $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 
     36    $this->LastQuery = 'INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')';
     37    $this->query($this->LastQuery); 
    3538  }
    3639 
     
    4548    }
    4649    $Values = substr($Values, 2); 
    47     $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')');
     50    $this->LastQuery = 'UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')';
     51    $this->query($this->LastQuery);
    4852  }
    4953 
     
    6266    $Values = substr($Values, 1);
    6367    //echo('REPLACE INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES ('.$Values.')<br>');
    64     $this->query('REPLACE INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')');
     68    $this->LastQuery = 'REPLACE INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')';
     69    $this->query($this->LastQuery);
    6570    //echo($this->error().'<br>');
    6671  }
     
    6873  function charset($Charset)
    6974  {
    70     $this->query('SET CHARACTER SET '.$Charset);
     75    $this->LastQuery = 'SET CHARACTER SET '.$Charset;
     76    $this->query($this->LastQuery);
    7177  }
    7278
Note: See TracChangeset for help on using the changeset viewer.