我正在尝试制作彩票游戏的搜索形式。我的目的是让表格找到所有抽出的 15 个数字中有 12 个相等的游戏。
我制作了一个表格,但它不起作用,因为它显示了所有包含至少 1 个成功结果的游戏。
我只想出现在每次抽签中匹配 12 个号码的游戏。
sql 文件只包含两行 id 和 numbers:
如果不存在 `lotto_table` 则创建表( `id` int(4) NOT NULL AUTO_INCREMENT, `数字`文本不为空, 主键(`id`) ) 引擎=MyISAM 默认字符集=latin1 AUTO_INCREMENT=4 ; -- -- Extraindo dados da tabela `lotto_table` -- 插入`lotto_table`(`id`,`numbers`)值 (3, '01, 04, 06, 07, 08, 09, 10, 11, 12, 14, 16, 17, 20, 23, 24'), (4, '01, 02, 04, 05, 08, 10, 12, 13, 16, 17, 18, 19, 23, 24, 25'), (5, '01, 02, 04, 08, 09, 11, 12, 13, 15, 16, 19, 20, 23, 24, 25'), (6, '01, 02, 04, 05, 06, 07, 10, 12, 15, 16, 17, 19, 21, 23, 25'), (7, '01, 04, 07, 08, 10, 12, 14, 15, 16, 18, 19, 21, 22, 23, 25'), (8, '01, 05, 06, 08, 09, 10, 13, 15, 16, 17, 18, 19, 20, 22, 25'), (9, '03, 04, 05, 09, 10, 11, 13, 15, 16, 17, 19, 20, 21, 24, 25'), (10, '02, 03, 04, 05, 06, 08, 09, 10, 11, 12, 14, 19, 20, 23, 24'), (11, '02, 06, 07, 08, 09, 10, 11, 12, 16, 19, 20, 22, 23, 24, 25'), (12, '01, 02, 04, 05, 07, 08, 09, 10, 11, 12, 14, 16, 17, 24, 25'), (13, '03, 05, 06, 07, 08, 09, 10, 11, 13, 14, 15, 16, 17, 19, 23'), (14, '01, 02, 05, 06, 07, 09, 13, 14, 15, 18, 19, 20, 21, 23, 25'), (15, '01, 02, 04, 06, 08, 10, 12, 15, 16, 18, 19, 21, 23, 24, 25'), (16, '02, 05, 06, 07, 08, 10, 12, 13, 15, 17, 19, 21, 23, 24, 25'), (17, '01, 02, 03, 05, 06, 07, 09, 13, 14, 16, 17, 18, 19, 20, 21'), (18, '02, 06, 07, 08, 10, 11, 14, 15, 17, 18, 19, 20, 22, 23, 24'), (19, '02, 05, 06, 07, 08, 10, 11, 13, 14, 15, 16, 17, 20, 23, 24'), (20, '03, 04, 06, 07, 08, 09, 10, 14, 16, 17, 18, 19, 20, 23, 24'), (21, '01, 02, 04, 05, 08, 11, 14, 16, 18, 19, 20, 22, 23, 24, 25'), (22, '01, 02, 03, 04, 05, 06, 07, 09, 10, 12, 13, 14, 15, 22, 25'), (23, '01, 03, 04, 05, 06, 08, 10, 11, 12, 14, 16, 17, 18, 19, 20'), (24, '01, 02, 03, 05, 07, 10, 11, 14, 17, 19, 20, 21, 23, 24, 25'), (25, '01, 02, 03, 04, 05, 06, 07, 09, 13, 14, 16, 20, 22, 23, 24'), (26, '05, 07, 08, 09, 10, 11, 13, 14, 16, 17, 19, 20, 21, 22, 23'), (27, '03, 06, 08, 10, 11, 12, 13, 14, 15, 18, 20, 21, 22, 24, 25'), (28, '01, 03, 07, 09, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21'), (29, '01, 04, 05, 06, 08, 09, 13, 14, 16, 17, 19, 20, 21, 22, 24'), (30, '01, 02, 03, 04, 06, 07, 08, 11, 14, 17, 19, 20, 21, 22, 23'), (31, '01, 02, 03, 04, 09, 13, 14, 15, 17, 19, 20, 21, 22, 24, 25'), (32, '01, 02, 04, 06, 07, 09, 10, 11, 14, 15, 16, 17, 20, 22, 23'), (33, '01, 02, 05, 07, 08, 10, 11, 12, 14, 16, 19, 20, 21, 23, 24'), (34, '01, 02, 04, 07, 08, 09, 10, 11, 15, 16, 18, 19, 20, 21, 23'), (35, '01, 04, 05, 06, 11, 12, 13, 14, 16, 17, 19, 21, 22, 23, 25'), (36, '01, 04, 05, 07, 08, 10, 11, 14, 17, 19, 20, 21, 22, 23, 24'), (37, '01, 03, 04, 05, 08, 09, 10, 11, 13, 15, 20, 21, 22, 23, 24'), (38, '01, 02, 03, 06, 07, 08, 09, 10, 13, 14, 15, 16, 22, 24, 25'), (39, '02, 07, 08, 09, 11, 13, 14, 15, 17, 18, 19, 21, 22, 23, 24'), (40, '01, 02, 05, 07, 08, 10, 12, 13, 14, 16, 17, 20, 21, 22, 24'), (41, '02, 03, 04, 09, 12, 13, 15, 16, 17, 18, 19, 20, 21, 23, 25'), (42, '01, 03, 04, 05, 06, 08, 11, 12, 14, 15, 17, 21, 22, 24, 25'), (43, '01, 03, 06, 07, 08, 09, 10, 14, 17, 18, 19, 20, 22, 23, 24'), (44, '03, 04, 05, 06, 10, 11, 12, 13, 14, 18, 19, 21, 23, 24, 25'), (45, '01, 02, 03, 05, 07, 09, 14, 16, 17, 18, 19, 21, 23, 24, 25'), (46, '01, 02, 04, 05, 06, 08, 10, 11, 14, 18, 19, 21, 23, 24, 25'), (47, '01, 02, 03, 04, 05, 06, 08, 10, 11, 13, 15, 18, 20, 22, 25'), (48, '02, 05, 06, 07, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23'), (49, '02, 04, 05, 06, 08, 11, 13, 15, 16, 19, 20, 21, 22, 23, 24'), (50, '01, 02, 03, 06, 07, 09, 10, 11, 12, 13, 19, 20, 21, 23, 25');
搜索表格:
<html>
<head>
<title>Search the Database</title>
</head>
<body>
<form action="search.php" method="post">
Search:
<input type="text" name="num1" />,
<input type="text" name="num2" />,
<input type="text" name="num3" />,
<input type="text" name="num4" />,
<input type="text" name="num5" />,
<input type="text" name="num6" />,
<input type="text" name="num7" />,
<input type="text" name="num8" />,
<input type="text" name="num9" />,
<input type="text" name="num10" />,
<input type="text" name="num11" />,
<input type="text" name="num12" />,<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>