Changeset 46 for trunk/Base/Database.php


Ignore:
Timestamp:
Jul 27, 2014, 9:05:14 PM (10 years ago)
Author:
chronos
Message:
  • Opraveno: SQL aktualizace 40 plus chybějící tabulka MeasureMethod.
  • Opraveno: Neplatné ukázkové konfigurační soubory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Base/Database.php

    r42 r46  
    1010  var $ShowSQLQuery = false;
    1111  var $ShowSQLError = false;
    12  
     12
    1313  function query($Query)
    14   { 
     14  {
    1515    if($this->ShowSQLQuery)
    1616    {
    17       if(isset($_SERVER['REMOTE_ADDR'])) echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.'</div>'); 
     17      if(isset($_SERVER['REMOTE_ADDR'])) echo('<div style="border-bottom-width: 1px; border-bottom-style: solid; padding-bottom: 3px; padding-top: 3px; font-size: 12px; font-family: Arial;">'.$Query.'</div>');
    1818      else echo($Query."\n");
    1919    }
     
    2525    }
    2626
    27     return($Result); 
     27    return($Result);
    2828  }
    2929
    3030  function select($Table, $What = '*', $Condition = 1)
    3131  {
    32     return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition)); 
     32    return($this->query('SELECT '.$What.' FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition));
    3333  }
    3434
    3535  function delete($Table, $Condition)
    3636  {
    37     $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition); 
     37    $this->query('DELETE FROM `'.$this->Prefix.$Table.'` WHERE '.$Condition);
    3838  }
    39  
     39
    4040  function insert($Table, $Data)
    4141  {
     
    5050    $Name = substr($Name, 1);
    5151    $Values = substr($Values, 1);
    52     $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')'); 
     52    $this->query('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')');
    5353  }
    54  
     54
    5555  function update($Table, $Condition, $Data)
    5656  {
     
    6161      $Values .= ', `'.$Key.'`='.$Value;
    6262    }
    63     $Values = substr($Values, 2); 
     63    $Values = substr($Values, 2);
    6464    $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')');
    6565  }
    66  
     66
    6767  function replace($Table, $Data)
    6868  {
     
    7979    //echo('REPLACE INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES ('.$Values.')<br />');
    8080    $this->query('REPLACE INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')');
    81     //echo($this->error().'<br>');
     81    //echo($this->error().'<br/>');
    8282  }
    83  
     83
    8484  function charset($Charset)
    8585  {
Note: See TracChangeset for help on using the changeset viewer.