From: Arun Persaud Date: Fri, 20 Jul 2007 18:09:00 +0000 (-0700) Subject: BUGFIX: reusing old randomnumbers didn't work X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=commitdiff_plain;h=910da8ec88cb67f13b84edbc0e61062b4789a8ab BUGFIX: reusing old randomnumbers didn't work old numbers got reused, but more than once for the same people should be fixed now. --- diff --git a/db.php b/db.php index 50cc3e5..41e4479 100644 --- a/db.php +++ b/db.php @@ -797,11 +797,14 @@ function DB_get_PREF($myid) function DB_get_unused_randomnumbers($userstr) { - $queryresult = mysql_query("SELECT randomnumbers,Game.id, COUNT(*) as num FROM Game ". - " LEFT JOIN Hand ON Hand.game_id=Game.id ". - " AND user_id not in (".$userstr.")". - " GROUP BY Game.id ". - " HAVING num=4"); + $queryresult = mysql_query(" SELECT randomnumbers FROM Game". + " WHERE randomnumbers NOT IN". + " (SELECT randomnumbers FROM Game". + " LEFT JOIN Hand ON Game.id=Hand.game_id". + " WHERE user_id IN (". $userstr .")". + " GROUP BY randomnumbers". + " )"); + $r = mysql_fetch_array($queryresult,MYSQL_NUM); if($r)