X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fdb.php;h=b8b184dd7673d73e8aaca176248b16fbfe89c347;hp=e389db410d3e0f5ffc258534c1068a9d8ee59aeb;hb=0edb4b26c049e07af0970e081fab699d2bdd333b;hpb=4209593d06a237995d8cc0ba527188a15cbd0376 diff --git a/include/db.php b/include/db.php index e389db4..b8b184d 100644 --- a/include/db.php +++ b/include/db.php @@ -18,8 +18,10 @@ function DB_open() mysql_select_db($DB_database) or die('Could not select database'); } else - return -1; - + { + echo mysql_errno() . ": " . mysql_error(). "\n"; + return -1; + } return 0; } @@ -1036,7 +1038,7 @@ function DB_get_userid($type,$var1="",$var2="") /* test if a recovery password has been set */ if(!$r) { - echo "testing alternative password"; + /* testing alternative password */ $result = DB_query("SELECT User.id FROM User". " LEFT JOIN Recovery ON User.id=Recovery.user_id". " WHERE email=".DB_quote_smart($var1). @@ -1147,4 +1149,10 @@ function DB_played_by_others($gameid) $gameids[]=$r[0]; return $gameids; } + +function DB_get_number_of_tricks($gameid,$position) +{ + $r = DB_query_array("SELECT COUNT(winner) FROM Trick Where game_id='$gameid' and winner='$position'"); + return $r[0]; +} ?> \ No newline at end of file