Ignore:
Timestamp:
Feb 20, 2015, 8:54:42 AM (9 years ago)
Author:
chronos
Message:
  • Modified: Show graph, table and other controls horizontally centered.
  • Added: Check for existence of config file.
  • Added: Check if database is accessible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/old/database.php

    r5 r50  
    77{
    88  var $Prefix = '';
    9  
     9
    1010  function select($Table, $What = '*', $Condition = 1)
    1111  {
     
    1818    $this->query("DELETE FROM `".$this->Prefix.$Table."` WHERE ".$Condition); 
    1919  }
    20  
     20
    2121  function insert($Table, $Data)
    2222  {
     
    2727      $Value = strtr($Value, '"', '\"');
    2828      $Name .= ','.$Key;
    29             if($Value == 'NOW()') $Values .= ",".$Value;
    30               else $Values .= ",'".$Value."'";
     29      if($Value == 'NOW()') $Values .= ",".$Value;
     30        else $Values .= ",'".$Value."'";
    3131    }
    3232    $Name = substr($Name, 1);
     
    3535    //echo('INSERT INTO `'.$this->Prefix.$Table.'` ('.$Name.') VALUES('.$Values.')');
    3636  }
    37  
     37
    3838  function update($Table, $Condition, $Data)
    3939  {
     
    4141    foreach($Data as $Key => $Value)
    4242    {
    43             $Value = strtr($Value, '"', '\"');
     43      $Value = strtr($Value, '"', '\"');
    4444      if($Value != 'NOW()') $Value = "'".$Value."'";
    4545      $Values .= ", ".$Key."=".$Value;
     
    4848    $this->query('UPDATE `'.$this->Prefix.$Table.'` SET '.$Values.' WHERE ('.$Condition.')');
    4949  }
    50  
     50
    5151  function replace($Table, $Data)
    5252  {
     
    6464    $this->query('REPLACE INTO `'.$this->Prefix.$Table.'` (`'.$Name.'`) VALUES('.$values.')');
    6565  }
    66  
     66
    6767  function charset($Charset)
    6868  {
     
    7171
    7272}
    73 
    74 ?>
Note: See TracChangeset for help on using the changeset viewer.