Changeset 10


Ignore:
Timestamp:
Jun 19, 2012, 8:56:06 AM (12 years ago)
Author:
maron
Message:

připojení do databáze

Location:
trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/class/Database.php

    r8 r10  
    1919  {
    2020    $this->Config = new Config();
    21     $this->Database->HostName = $this->Config->Database['Host'];
    22     $this->Database->UserName = $this->Config->Database['User'];
    23     $this->Database->Password = $this->Config->Database['Password'];
    24     $this->Database->Schema = $this->Config->Database['Database'];
    25     $this->Database->Charset = $this->Config->Database['Charset'];
    26     $this->Database->ShowSQLQuery = $this->Config->Web['ShowSQLQuery'];
    27     $this->Database->ShowSQLError = $this->Config->Web['ShowSQLError'];
     21    $this->HostName = $this->Config->Database['Host'];
     22    $this->UserName = $this->Config->Database['User'];
     23    $this->Password = $this->Config->Database['Password'];
     24    $this->Schema = $this->Config->Database['Database'];
     25    $this->Charset = $this->Config->Database['Charset'];
     26    $this->ShowSQLQuery = $this->Config->Web['ShowSQLQuery'];
     27    $this->ShowSQLError = $this->Config->Web['ShowSQLError'];
    2828    $this->open();
    2929   
     
    3838  function query($Query)
    3939  {
    40  
    4140    if($this->ShowSQLQuery)
    4241    {
     42  echo $this->ShowSQLQuery;
    4343      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>');
    4444      else echo($Query."\n");
  • trunk/index.php

    r6 r10  
    1616        }
    1717
     18        //creating objects
    1819        $Database = new Database();
     20        $User = new User($Database);
     21
     22
     23        //main body
    1924        $Gui = new Gui();
     25       
     26        $User->Login('maron','test');
    2027       
    2128        $Gui->ShowPage();
    2229       
    2330       
     31        //destroing objects
     32        $User->__Destroy();
     33       
    2434?>
Note: See TracChangeset for help on using the changeset viewer.