嗨,我已经使用 3 个表的 mysql 查询在表单上创建了一个下拉组合框,这工作正常,现在我想在运行查询的下拉组合中选择一个项目时在数据库上执行另一个查询在数据库上并返回在定义的字段中使用附加数据填充表单所需的值。以下是我到目前为止的进度....
$query3 = "SELECT customers.id, customers.email, customers_customfields.customer_id, customers_customfields.field_value, orders.sign_date, orders.sub_id, orders.domain_name, orders.cust_status
FROM customers, customers_customfields, customers_orders, orders
WHERE customers_orders.order_id = orders.sub_id
AND customers.id = customers_orders.customer_id
AND customers.id = customers_customfields.customer_id
AND customers_customfields.field_id = 1";
$result = mysql_query ($query3);
echo "<select name=orders value='Select from the list provided '>";
while($drop=mysql_fetch_array($result)){
//data stored in $drop
echo "<option value=$drop[id]>$drop[sub_id] $drop[id] $drop[field_value] $drop[sign_date] $drop[domain_name] $drop[cust_status]</option>";
}
echo "</select>";