Skip to content

Commit

Permalink
public function cleanUnivers($id_game)
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne-Breda committed Apr 12, 2014
1 parent 1f39290 commit db80522
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions attlestar/php/SQLdata.Class.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,19 @@ public function getPlayer($id_game)
return $data;
$db->close();
}

public function cleanUnivers($id_game)
{
$db = new PDO("mysql:host=127.0.0.1;dbname=rush2", "root", "abc123");
$query = $db->prepare("SELECT date FROM game WHERE ? = id");
$query->execute(array($id_game));
$data = $query->fetch();
if ($date + 3600 < time())
{
$query = $db->prepare("DELETE FROM game WHERE game.id = ?");
$query->execute(array($id_game));
}
$db->close();
}
}
?>

0 comments on commit db80522

Please sign in to comment.