public function insert() { $pdo = Database::getPDO(); $stmt = $pdo->prepare("INSERT INTO " . self::$databaseTable . " (timestamp, server_id, map, gamemode) VALUES(:timestamp, :server_id, :map, :gamemode)"); $stmt->execute(array('timestamp' => $this->getTimestampString(), 'server_id' => $this->getServer()->getId(), 'map' => $this->getMap(), 'gamemode' => $this->getGameMode())); $this->setId($pdo->lastInsertId()); }
public function insert($timestamp = null) { if ($timestamp == null) { $timestamp = time(); } $pdo = Database::getPDO(); $stmt = $pdo->prepare("INSERT INTO " . self::$databaseTable . " (timestamp, ip_address, json) VALUES(:timestamp, :ip_address, :json)"); $stmt->execute(array('timestamp' => $this->getTimestampString(), 'ip_address' => $this->ipAddress, 'json' => $this->json)); }
public function getKategori($sql1) { $db = new Database(); $pdo1 = $db->getPDO(); $stmt2 = $pdo1->prepare($sql1); $stmt2->execute(); while ($rows = $stmt2->fetch()) { $dataa[] = $rows; } return $dataa; }
public function insert() { $pdo = Database::getPDO(); $stmt = $pdo->prepare("INSERT INTO " . self::$databaseTable . " (" . "match_id, player_id, frags, deaths, flags, teamkills, shotdamage, damage, effectiveness) " . "VALUES(:match_id, :player_id, :frags, :deaths, :flags, :teamkills, :shotdamage, :damage, :effectiveness)"); $stmt->execute(array('match_id' => $this->match->getId(), 'player_id' => $this->player->getId(), 'frags' => $this->frags, 'deaths' => $this->deaths, 'flags' => $this->flags, 'teamkills' => $this->teamkills, 'shotdamage' => $this->shotDamage, 'damage' => $this->damage, 'effectiveness' => $this->effectiveness)); $this->setId($pdo->lastInsertId()); }
public function insert() { $pdo = Database::getPDO(); $stmt = $pdo->prepare("INSERT INTO " . self::$databaseTable . " (timestamp, server_id, player_id, connection_time) VALUES(:timestamp, :server_id, :player_id, :connection_time)"); $stmt->execute(array('timestamp' => $this->getTimestampString(), 'server_id' => $this->server->getId(), 'player_id' => $this->player->getId(), 'connection_time' => $this->connectionTime)); }
public function insert() { $pdo = Database::getPDO(); $stmt = $pdo->prepare("INSERT INTO " . self::$databaseTable . " (timestamp, server_id, player_id, target_id, gun) VALUES(:timestamp, :server_id, :player_id, :target_id, :gun)"); $stmt->execute(array('timestamp' => $this->getTimestampString(), 'server_id' => $this->server->getId(), 'player_id' => $this->player->getId(), 'target_id' => $this->target->getId(), 'gun' => $this->gun)); }
/** * Get id of last inserted row * @see \PDO::lastInsertId() * @param null $table * @return string */ public function getLastInsertID($table = null) { return $this->database->getPDO()->lastInsertId($table); }
public function insert() { $pdo = Database::getPDO(); $stmt = $pdo->prepare("INSERT INTO " . self::$databaseTable . " (timestamp, server_id, player_id, new_name, old_name) VALUES(:timestamp, :server_id, :player_id, :new_name, :old_name)"); $stmt->execute(array('timestamp' => $this->getTimestampString(), 'server_id' => $this->server->getId(), 'player_id' => $this->player->getId(), 'new_name' => $this->getNewName(), 'old_name' => $this->getOldName())); }
unset($params['page']); if ($page > 0) { $ret .= "<a href=\"?" . http_build_query($params) . "&page=" . ($page - 1) . "\">« Prev</a>"; } else { $ret .= "« Prev"; } $ret .= " • "; if ($page < $total_pages - 1) { $ret .= "<a href=\"?" . http_build_query($params) . "&page=" . ($page + 1) . "\">Next »</a>"; } else { $ret .= "Next »"; } return $ret; } try { $pdo = Database::getPDO(); switch ($section) { case 'search': if (isset($_GET['search']) && strlen($_GET['search']) > 2) { $st = $pdo->prepare("SELECT (SELECT MAX(connects.timestamp) FROM connects WHERE connects.player_id = players.id) AS last_connected, players.* FROM players WHERE name LIKE :searchLike OR ip_address = :search ORDER BY last_connected DESC LIMIT 100"); $st->execute(array('searchLike' => '%' . str_replace(array('%', '_'), array('\\%', '\\_'), trim($_GET['search'])) . '%', 'search' => $_GET['search'])); $searchResults = $st->fetchAll(PDO::FETCH_ASSOC); if (isset($searchResults) && $searchResults) { ?> <table border="1"> <tr> <th>Name</th> <th>IP</th> <?php if (function_exists('geoip_country_name_by_name')) { ?>