From 15e85c12f9392246845f5c611f5faafe8660a9e2 Mon Sep 17 00:00:00 2001 From: arun <arun@nubati.net> Date: Sat, 3 Feb 2007 04:57:04 +0000 Subject: added session to database --- db.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'db.php') diff --git a/db.php b/db.php index 1b047d3..38b788c 100644 --- a/db.php +++ b/db.php @@ -512,4 +512,27 @@ function DB_set_startplayer_by_gameid($id,$p) return; } +function DB_get_session_by_gameid($id) +{ + $result = mysql_query("SELECT session FROM Game WHERE id=".DB_quote_smart($id)); + $r = mysql_fetch_array($result,MYSQL_NUM); + + if($r) + return $r[0]; + else + return NULL; +} + +function DB_get_max_session() +{ + $result = mysql_query("SELECT MAX(session) FROM Game"); + $r = mysql_fetch_array($result,MYSQL_NUM); + + if($r) + return $r[0]; + else + return 0; +} + + ?> \ No newline at end of file -- cgit v1.2.3-18-g5258