1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Help error create player sqlite

Discussion in 'Help' started by Mochi, May 11, 2020.

  1. Mochi

    Mochi Baby Zombie

    Messages:
    113
    [16:43:44] [Server thread/CRITICAL]: ErrorException: "SQLite3::query(): 10 values for 9 columns" (EXCEPTION) in "plugins/SkyWars[0.1]/src/sw/stats/DataBase" at line 53

    Code:
    PHP:
    public function createPlayer(Player $player)
        {
            
    $name strtolower($player->getName());

            if (!
    $this->db->query("SELECT * FROM Stats WHERE name = '$name'")->fetchArray(SQLITE3_ASSOC)) {
                
    $this->db->query("INSERT INTO Stats (name, level, xplevel, xpneed, kills, deaths, wins, winst, winsm) VALUES ('$name', 0, 0, 0, 0, 0, 0, 0, 0, 0);"); line53

                Level
    ::getInstance()->defaultLevel($player);

                
    $this->sw->getLogger()->notice("New user " $player->getLowerCaseName() . "!Register to the database...");
            }
        }
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Your insert statement has 10 values, but only 9 columns
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.