Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function create() {
- do {
- $code = Game::randStr();
- $query = 'INSERT IGNORE INTO games (code, player_count, valid_from, valid_to) VALUES (?, 2, DATE_ADD(CURDATE(), INTERVAL 8 HOUR), DATE_ADD(CURDATE(), INTERVAL 20 HOUR));';
- $pstmt = self::$db->query($query, array($code));
- } while ($pstmt->rowCount() == 0);
- return $pstmt->lastInsertId();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement