我使用
Jquery Multiselect Widget有一个带有mulitselect选项的下拉列表框.我正在使用MySql数据库中的数据填充下拉列表.我无法将多个值传递给$_POST中的php文件.
我的HTML& Multiselect DropDown的PHP代码.
Last 1 Week
Last 2 Week
Last 3 Week
//include '../db/interface/DB_Manager.php';
$connect = mysql_connect("localhost", "root", "infinit") or die(mysql_error());
mysql_select_db("serverapp") or die(mysql_error());
$query = "select id,name from rpt_shift_def"; //Write a query
$data = mysql_query($query); //Execute the query
?>
while($fetch_options = mysql_fetch_array($data)) { //Loop all the options retrieved from the query
?>
}
?>
这里我在Multiselect Dropdown中填充Shift下拉列表.如果我选择多个班次,我无法在php中获得所有这些选定的值.相反,我只得到最后一个选定的值.
我想做这样的事情.
$shiftarraycalc = array();
foreach ($_POST['selectShift'] as $key => $value) {
array_push($shiftarraycalc,$value);
}
但它不起作用.
我不知道如何在$_POST中获取多个值.