ユーザーが知っている情報を送信し、返してほしい情報を選択できる Web ページを作成しようとしています。たとえば、申請の ID 番号がわかっている場合は、それを入力して、返された値が ID 番号と製品名になるように要求できます。
取得される情報は MySQL データベースに保存され、html ページは選択メニュー、テキスト ボックス、およびチェックボックスでレイアウトされます (ユーザーが名前を選択したり、他の情報を入力したり、チェックボックスを使用して選択したりできるように)返してもらいたいその他の情報)。
関連するhtmlは次のとおりです。
<table><tr>
<form name="input" method="post" action="next.php">
<td width="120">Flowcell ID:<br />
<select name = "Flowcell_ID">
<option disabled="disabled" selected="selected">
Select...
</option>
<?php
$link = mysqli_connect("localhost","user","pass","db");
$query = "SELECT DISTINCT ID FROM table";
$result = mysqli_query($link, $query);
while ($row = mysqli_fetch_array($result)){
$id = $row['ID'];
echo "<option value=\"$id\">$id</option>";
}
mysqli_close($link);
?>
</select></td>
</tr><tr>
<td width="120">Name:<input type="text" name="Name" /></td>
</tr><tr>
<td width="120">Date:<input type="text" name="Date" /></td>
</tr><tr>
<td width="120">Group:<input type="text" name="Group" /></td>
</tr><tr>
<td width="120"><input type="checkbox" name="options[]" value="ID">ID</input></td>
<td width="120"><input type="checkbox" name="options[]" value="Name">Name</input></td>
<td width="120"><input type="checkbox" name="options[]" value="Date">Date</input></td>
<td width="120"><input type="checkbox" name="options[]" value="Group">Group</input></td>
</tr></table>
私がこれまでに持っている唯一のphpは次のとおりです。
$id = $_POST['ID'];
$name = $_POST['Name'];
$date = $_POST['Date'];
$group = $_POST['Group'];
次のような MySQL クエリを作成するにはどうすればよいですか
SELECT [checked checkboxes] FROM table WHERE [information field] = [user-entered information]
?
ありがとう!