Changeset 3


Ignore:
Timestamp:
Sep 10, 2018, 1:18:27 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Bad database insert_id after inserting new Runners.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.sample.php

    r2 r3  
    22
    33$Config['Database']['Host'] = 'localhost';
    4 $Config['Database']['User'] = 'tanec';
     4$Config['Database']['User'] = 'teribear';
    55$Config['Database']['Password'] = '';
    6 $Config['Database']['Database'] = 'tanec';
     6$Config['Database']['Database'] = 'teribear';
    77$Config['Database']['Prefix'] = '';
    88$Config['Database']['Charset'] = 'utf8';
  • trunk/Run.php

    r2 r3  
    2121      ));
    2222      $Result = 1;
    23       $this->Id = $DbResult->insert_id;
     23      $this->Id = $this->Database->insert_id;
    2424    } else {
    2525      $Result = 0;
  • trunk/index.php

    r2 r3  
    6060    $URL = 'http://leaderboard.teribear.cz/Home/GetRunners?category='.$Category.'&page='.$Page.'&teamId='.$TeamId.'&query='.$Query;
    6161    if ($Category != '') $URL .= '&startNumber='.$StartNumber;
    62     echo($URL);
    6362    $Content = file_get_contents($URL);
    6463    $JSON = json_decode($Content, true);
     
    8382        $RunnerItem->ChipNumber = $Runner['ChipNumber'];
    8483        if ($Runner['Type'] == 'man') $RunnerItem->Gender = 1;
    85         if ($Runner['Type'] == 'woman') $RunnerItem->Gender = 0;
     84        if ($Runner['Type'] == 'woman') $RunnerItem->Gender = 2;
    8685        $RunnerItem->Team = $Team['Id'];
    8786        $RunnerItem->AddIfNotExist();
Note: See TracChangeset for help on using the changeset viewer.