diff options
author | Arun Persaud <arun@nubati.net> | 2007-07-20 11:09:00 -0700 |
---|---|---|
committer | Arun Persaud <arun@ebit2.lbl.gov> | 2007-07-20 11:17:29 -0700 |
commit | 910da8ec88cb67f13b84edbc0e61062b4789a8ab (patch) | |
tree | 23a8a5f2c6aade60130e317ff2754cc92c5eff3e /db.php | |
parent | 54ea7b7fae46bae795d72ff671c15091ae505256 (diff) | |
download | e-DoKo-910da8ec88cb67f13b84edbc0e61062b4789a8ab.tar.gz e-DoKo-910da8ec88cb67f13b84edbc0e61062b4789a8ab.tar.bz2 e-DoKo-910da8ec88cb67f13b84edbc0e61062b4789a8ab.zip |
BUGFIX: reusing old randomnumbers didn't work
old numbers got reused, but more than once for the same people
should be fixed now.
Diffstat (limited to 'db.php')
-rw-r--r-- | db.php | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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) |