From 4afb2915193523f99f360e27477afefcb19ed079 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 29 Nov 2015 15:51:54 -0800 Subject: reuse random number: test select distinct --- include/db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') 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;"); -- cgit v1.2.3-18-g5258