summaryrefslogtreecommitdiffstats
path: root/db.php
diff options
context:
space:
mode:
Diffstat (limited to 'db.php')
-rw-r--r--db.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/db.php b/db.php
index bae70cb..f883fff 100644
--- a/db.php
+++ b/db.php
@@ -484,7 +484,6 @@ function DB_get_max_trickid($gameid)
$result = mysql_query("SELECT MAX(id) FROM Trick WHERE game_id=".DB_quote_smart($gameid));
$r = mysql_fetch_array($result,MYSQL_NUM) ;
-
return ($r?$r[0]:NULL);
}
@@ -591,6 +590,7 @@ function DB_get_user_timezone($userid)
function DB_insert_comment($comment,$playid,$userid)
{
mysql_query("INSERT INTO Comment VALUES (NULL,NULL,NULL,$userid,$playid, ".DB_quote_smart($comment).")");
+
return;
}
@@ -817,4 +817,19 @@ function DB_get_card_name($card)
return "Error during get_card_name ".$card;
}
+function DB_get_current_playid($gameid)
+{
+ $trick = DB_get_max_trickid($gameid);
+
+ if(!$trick) return NULL;
+
+ $queryresult = mysql_query("SELECT id FROM Play WHERE trick_id='$trick' ORDER BY create_date DESC LIMIT 1");
+
+ $r = mysql_fetch_array($queryresult,MYSQL_NUM);
+ if($r)
+ return $r[0];
+
+ return "";
+}
+
?> \ No newline at end of file