diff options
author | Arun Persaud <arun@nubati.net> | 2015-11-29 15:51:54 -0800 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2015-11-29 21:19:07 -0800 |
commit | 4afb2915193523f99f360e27477afefcb19ed079 (patch) | |
tree | 47574f0f30a634585e633a891d3d3e646e0dc423 /include | |
parent | e2db7fab7569c20afa4f7915edb70842ae1aed8e (diff) | |
download | e-DoKo-4afb2915193523f99f360e27477afefcb19ed079.tar.gz e-DoKo-4afb2915193523f99f360e27477afefcb19ed079.tar.bz2 e-DoKo-4afb2915193523f99f360e27477afefcb19ed079.zip |
reuse random number: test select distinct
Diffstat (limited to 'include')
-rw-r--r-- | include/db.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/db.php b/include/db.php index b84a3ae..fa7d564 100644 --- a/include/db.php +++ b/include/db.php @@ -918,7 +918,7 @@ function DB_get_unused_randomnumbers($userstr) */ DB_query("DROP TEMPORARY TABLE IF EXISTS gametmp;"); DB_query("CREATE TEMPORARY TABLE gametmp SELECT id,randomnumbers FROM Game;"); - DB_query("DELETE FROM gametmp WHERE randomnumbers IN (SELECT randomnumbers FROM Hand LEFT JOIN Game ON Game.id=game_id WHERE user_id IN (".$userstr."));"); + DB_query("DELETE FROM gametmp WHERE id IN (SELECT distinct game_id FROM Hand LEFT JOIN Game ON Game.id=game_id WHERE user_id IN (".$userstr."));"); $r = DB_query_array("SELECT randomnumbers FROM gametmp LIMIT 1;"); DB_query("DROP TEMPORARY TABLE IF EXISTS gametmp;"); |