Michaël Boeyens 3 anni fa
parent
commit
9dd1580259
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. BIN
      db.sqlite
  2. 2
    2
      dbase.inc

BIN
db.sqlite Vedi File


+ 2
- 2
dbase.inc Vedi File

public function userScoreQuery($spelerId) public function userScoreQuery($spelerId)
{ {
$stmtUserScore = $this->db->prepare("SELECT date, won, difficulty FROM game WHERE user_id = :usrid ORDER BY date"); $stmtUserScore = $this->db->prepare("SELECT date, won, difficulty FROM game WHERE user_id = :usrid ORDER BY date");
$stmtUserScore->bindValue('usrid', $spelerId, SQLITE3_INTEGER);
$stmtUserScore->bindValue(':usrid', $spelerId, SQLITE3_INTEGER);
return $stmtUserScore->execute(); return $stmtUserScore->execute();
} }


$resultStmt = $this->db->prepare("INSERT INTO game (user_id, date, won, difficulty) VALUES (:splrId, :date, :splrscr, '{$_SESSION['game']->difficulty}')"); $resultStmt = $this->db->prepare("INSERT INTO game (user_id, date, won, difficulty) VALUES (:splrId, :date, :splrscr, '{$_SESSION['game']->difficulty}')");
$resultStmt->bindValue(':splrId', $_SESSION['spelerId'], SQLITE3_INTEGER); $resultStmt->bindValue(':splrId', $_SESSION['spelerId'], SQLITE3_INTEGER);
$resultStmt->bindValue(':date', date('Y-m-d H:i:s'), SQLITE3_TEXT); $resultStmt->bindValue(':date', date('Y-m-d H:i:s'), SQLITE3_TEXT);
$resultStmt->bindValue('splrscr', $_SESSION['game']->gameResult, SQLITE3_INTEGER);
$resultStmt->bindValue(':splrscr', $_SESSION['game']->gameResult, SQLITE3_INTEGER);
$resultStmt->execute(); $resultStmt->execute();
} }
} }

Loading…
Annulla
Salva