Fix Unsupported operand types

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Fix Unsupported operand types

      The error code below occurs intermittently.
      I Added source to prevent errors.

      =================================
      [30-Dec-2022 12:00:02] USER ERROR: "Unsupported operand types"
      File: ShowGalaxyPage.class.php | Line: 91
      URL: /game.php?page=galaxy | Version: 2.0.git
      Stack trace:
      #0 /game.php(57): ShowGalaxyPage->show()
      #1 {main}
      =================================

      1. Open file
      includes/pages/game/ShowGalaxyPage.class.php

      fine code

      PHP Source Code

      1. $sql = 'SELECT total_points
      2. FROM %%STATPOINTS%%
      3. WHERE id_owner = :userId AND stat_type = :statType ;';
      4. $USER += Database::get()->selectSingle($sql, array(
      5. ':userId' => $USER['id'],
      6. ':statType' => 1
      7. ));

      add before


      PHP Source Code

      1. ## add code
      2. $sql = "SELECT total_points FROM %%STATPOINTS%% WHERE stat_type = '1' AND id_owner = :userId;";
      3. $ckusers = Database::get()->selectSingle($sql, array(
      4. ':userId' => $USER['id']
      5. ));
      6. if(empty($ckusers)){
      7. $this->printMessage("Point error. Moving will fix it.", array(array(
      8. 'label' => $LNG['sys_back'],
      9. 'url' => 'game.php?page=galaxy'
      10. )));
      11. }
      12. ## END
      Display All

      END....
      --------------------------------------------------------------------------------------