summaryrefslogtreecommitdiffstats
path: root/db.php
diff options
context:
space:
mode:
authorarun <arun@nubati.net>2007-04-10 15:26:58 +0000
committerarun <arun>2007-04-10 15:26:58 +0000
commit97dc3b828845ca92c4eab2b0df38afdbc167b423 (patch)
treef0b043623346c1b0a0e256cd871fc8b20c3abbd5 /db.php
parent4b94fd36ed89060493ac80d89db3c1e304b13623 (diff)
downloade-DoKo-97dc3b828845ca92c4eab2b0df38afdbc167b423.tar.gz
e-DoKo-97dc3b828845ca92c4eab2b0df38afdbc167b423.tar.bz2
e-DoKo-97dc3b828845ca92c4eab2b0df38afdbc167b423.zip
added email to first player at the beginning of the game; fixed small layout issue
Diffstat (limited to 'db.php')
-rw-r--r--db.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/db.php b/db.php
index b3651bd..7b6ba17 100644
--- a/db.php
+++ b/db.php
@@ -70,6 +70,21 @@ function DB_get_email_by_userid($id)
return "";
}
+function DB_get_email_by_pos_and_gameid($pos,$gameid)
+{
+ $result = mysql_query("SELECT email FROM User ".
+ "LEFT JOIN Hand ON User.id=Hand.user_id ".
+ "LEFT JOIN Game ON Game.id=Hand.game_id ".
+ "WHERE Game.id=".DB_quote_smart($gameid)." ".
+ "AND Hand.position=".DB_quote_smart($pos)."");
+ $r = mysql_fetch_array($result,MYSQL_NUM);
+
+ if($r)
+ return $r[0];
+ else
+ return "";
+}
+
function DB_get_email_by_hash($hash)
{
$result = mysql_query("SELECT User.email FROM User LEFT JOIN Hand ON Hand.user_id=User.id WHERE Hand.hash=".DB_quote_smart($hash)."");
@@ -179,6 +194,17 @@ function DB_get_name_by_hash($hash)
return "";
}
+function DB_get_name_by_email($email)
+{
+ $result = mysql_query("SELECT fullname FROM User WHERE email=".DB_quote_smart($email));
+ $r = mysql_fetch_array($result,MYSQL_NUM);
+
+ if($r)
+ return $r[0];
+ else
+ return "";
+}
+
function DB_get_name_by_userid($id)
{
$result = mysql_query("SELECT fullname FROM User WHERE id=".DB_quote_smart($id));