I have retrieved the database values in dropdown list with multiple select option using PHP MySQL. My code is as follows.
$sql = "SELECT student_id, name, phone FROM student";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<select name='num' multiple >";
while($row = $result->fetch_assoc()) {
echo "<option value='" . "'>" . $row['name']. " " . $row['phone_number'] ."</option>";
}
echo "</select>";
} else {
echo "0 results";
}
What I need is, I want to post the multiple selected phone_number values to another page. Also, Is it possible to create a checkbox before the list values?
