在我的下拉列表中,每一行都有来自 db 的 3 个字段。我需要以某种方式将这些传递给另一个表单,我将在另一个 SQL 语句中引用它们。
我不确定如何通过它们。任何帮助将非常感激。
<form action='obtainaprice.php' method='POST'>
<?php
echo "<select name='makes' id='searchtext'>\n";
$query1 = "SELECT DISTINCT make, type, model FROM device ORDER BY make, type, model";
$result1 = mysql_query($query1)
or die ("Couldn't execute query.");
while ($row1 = mysql_fetch_array($result1))
{
$i=0;
echo "<option value= \"" . $i . "\">" . $row1['make'] . " " . $row1['type'] . " " . $row1['model'] . "</option>";
$i++;
}
echo "</select>\n";
?>
<input type="image" id="buttons" alt="Search" img src="images/button.png">
</form>