我有一个带有选择框的表单,用户可以在其中从数据库中选择预先存在的字段:
<form action='' method='POST' autocomplete='off' enctype="multipart/form-data">
<p><strong>Title and Description:</strong></p>
<select name='uidtitle' class='chosen-select'>
<option value="0" ></option>
<?php
$result = $mysqli->query("SELECT uid, title, description FROM tblFacilityHrs") or die($mysqli->error);
while ($row = $result->fetch_array(MYSQLI_ASSOC)){
echo "<option value=\"1\">" . $row['title'] ." - " . $row['description'] . "</option>";
$uid = $row['uid'];
$title = $row['title'];
$desc = $row['description'];
}
?>
</select>
...
如何将所有这三个值(分别)发送到我的 SQL 回发?
if (isset($_POST['submitted'])) {
//Get params for prepared statements
$startDatec= date("Y-m-d H:i:s", strtotime($_POST['startEventDate']));
$endDatec= date("Y-m-d H:i:s", strtotime($_POST['endEventDate']));
$startTimec=$_POST['startTime'];
$endTimec=$_POST['endTime'];
$recurc=$_POST['recurrence'];
$finalc= date("Y-m-d H:i:s", strtotime($_POST['finalDate']));
...