Changeset 597


Ignore:
Timestamp:
May 20, 2009, 12:52:52 PM (16 years ago)
Author:
george
Message:
  • Přidáno: Rozšířená databázová třída pro potřeby zobrazení SQL povelů a jejich chyb.
  • Opraveno: Chyba výběru databáze realmd na stránce registrace.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/inc/config.sample.php

    r582 r597  
    2727    'DatabaseScriptDev2' => 'scriptdev2',
    2828    'GMCommandsLog' => 'gm_commands.log',
    29     'MaxAccountCount' => 13000,
    3029    'CharacterDataOffset' => array
    3130    (
     
    4746    'Admin' => 'Admin',
    4847    'AdminEmail' => 'admin@localhost',
    49     'ShowError' => 0,
     48    'ShowError' => false,
    5049    'ErrorLogFile' => 'php_script_error.log',
     50    'ShowSQLError' => false,
     51    'ShowSQLQuery' => false,
    5152  ),
    5253  'CheckRegistration' => array
  • trunk/inc/db.php

    r591 r597  
    22
    33include('config.php');
     4include('database.php');
    45
    5 $db = new mysqli($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
    6 if(mysqli_connect_errno())
     6$db = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
     7if(mysqli_connect_error())
    78{
    8   die('Přihlášení k MySQL selhalo. '.mysqli_connect_error());
     9  die('Přihlášení k databázi selhalo. '.mysqli_connect_error());
    910}
    10 $db->query('SET NAMES '.$Config['Database']['Charset']);
     11$db->charset($Config['Database']['Charset']);
    1112
    1213?>
  • trunk/pages/register.php

    r596 r597  
    3939  '<br />');
    4040
    41 $db->select_db($Config['Mangos']['DatabaseRealmd']);
    4241if($RegistrationLimit->GetFreeRegistrationCount() == 0)
    4342{
     
    6261      $heslo = sha_password($account, $password);
    6362
     63      $db->select_db($Config['Mangos']['DatabaseRealmd']);
    6464      $DbResult = $db->query('SELECT `id`, `username`, `sha_pass_hash` FROM `account` WHERE `username`="'.$account.'"');
    6565      if($DbResult->num_rows > 0)
  • trunk/sql/updates/596.sql

    r596 r597  
    22`Date` DATE NOT NULL ,
    33`Min` INT NOT NULL ,
    4 `Max` INT NOT NULL
     4`Max` INT NOT NULL ,
    55`AccountCount` int(11) NOT NULL,
    66PRIMARY KEY  (`Date`)
Note: See TracChangeset for help on using the changeset viewer.