1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <select name="product_occasions[]" id="select_attribute" multiple>
<?php if (isset($_POST['product_occasions']))
{ $arr = $_POST['product_occasions'];
foreach ($arr as $k => $v)
{ ?> <option value="<?php echo $v; ?>" selected="selected" > <?php echo $v['occasion_title]; ?></option>
<?php
}
}
$get_occasion = mysqli_query($con,"select * from product_occasion order by occasion_title");
while ($occasions=mysqli_fetch_array($get_occasion))
{
$occasion_id = htmlspecialchars($occasions['occasion_id']);
$occasion_title = htmlspecialchars($occasions['occasion_title']);
echo "<option value='$occasion_id'> $occasion_title </option>";
}
?>
</select> |
Partager