moved files to top of domain and found a few links that didn't use the one defined...
[e-DoKo.git] / db.php
diff --git a/db.php b/db.php
index fde7ab67cb9e5c8bf6571a3e6a95f9db8a5c3c30..4b18d9c526f23e411ffbcec7b98a06dfb1c7c57b 100644 (file)
--- a/db.php
+++ b/db.php
@@ -100,6 +100,16 @@ function DB_get_userid_by_email($email)
   else
     return 0;
 }
+function DB_get_userid_by_email_and_password($email,$password)
+{
+  $result = mysql_query("SELECT id FROM User WHERE email=".DB_quote_smart($email)." AND password=".DB_quote_smart($password));
+  $r      = mysql_fetch_array($result,MYSQL_NUM);
+  
+  if($r)
+    return $r[0];
+  else
+    return 0;
+}
 
 function DB_get_handid_by_hash($hash)
 {
@@ -145,6 +155,17 @@ function DB_get_name_by_hash($hash)
     return "";
 }
 
+function DB_get_name_by_userid($id)
+{
+  $result = mysql_query("SELECT fullname FROM User  WHERE id=".DB_quote_smart($id));
+  $r      = mysql_fetch_array($result,MYSQL_NUM);
+  
+  if($r)
+    return $r[0];
+  else
+    return "";
+}
+
 function DB_get_status_by_hash($hash)
 {
   $result = mysql_query("SELECT status FROM Hand WHERE hash=".DB_quote_smart($hash));
@@ -267,7 +288,7 @@ function DB_set_solo_by_hash($me,$solo)
   return;
 }
 
-function DB_set_sickness_by_hash($me,$sickness)
+function DB_set_sickness_by_hash($hash,$sickness)
 {
   mysql_query("UPDATE Hand SET sickness=".DB_quote_smart($sickness)." WHERE hash=".DB_quote_smart($hash));
   return;