S
S
Sergey Semenko2015-04-20 18:18:19
PHP
Sergey Semenko, 2015-04-20 18:18:19

SQLite - Where is the error here?

I've already broken my head, but I can't find the error

public function accept(Player $player) {
    $playerName = strtolower($player->getName());
    
    $stmt = self::getDB()->prepare('UPDATE clan_players SET status = :status
        WHERE player = :player AND clan_id = :id AND status = :invite LIMIT 1');
    $stmt->bindValue(':id', $this->getId(), SQLITE3_INTEGER);
    $stmt->bindValue(':status', self::STATUS_OK, SQLITE3_INTEGER);
    $stmt->bindValue(':invite', self::STATUS_INVITE, SQLITE3_INTEGER);
    $stmt->bindValue(':player', $playerName, SQLITE3_TEXT);
    
    return $stmt->execute();
  }

Error text
[WARNING] RuntimeException: "SQLite3::prepare(): Unable to prepare statement: 1, near "LIMIT": syntax error" (E_WARNING) in "src/Clan.php" at line 74

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
He11ion, 2015-04-20
@abler98

Maybe SQLite was built without LIMIT support in UPDATE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question