此问题在此处已有答案:
Acquiring multiple values from one select option value. PHP HTML(3个答案)
How to post two values in an option field?(6个答案)
How can i send two values from the same select option to a url in php?(2个答案)
how to give multiple values to a select-option tag?(5个答案)
Pass Multiple Values In HTML Option Tag Via PHP(1个答案)
昨天关门了。
我的表中有4列
SUGAR_ID
LEVEL
VALUE
VOLUME
我想从选择一行中同时获取水平和体积,该怎么做?
$query = "SELECT * FROM sugarlevel order by SUGAR_ID asc";
$result = mysqli_query($db, $query) or die ("Bad SQL: $query");
$sugaa = "<select class='btn btn-success' name='sugarlevel' required>
<option disabled selected hidden>Sugar Level</option>";
while ($row = mysqli_fetch_assoc($result)) {
$sugaa .= "<option value='".$row['LEVEL']."'>".$row['LEVEL']."</option>";
}
$sugaa .= "</select>";
1条答案
按热度按时间n6lpvg4x1#
一个简单的方法是设置:
我已经用了'|'作为分隔符,您可以选择最适合您的
然后,一旦接收到值:
显然,这是一个必须改进的例子,特别是出于“安全”的原因