Dec 28, 2022 02:07 PM
(This post was last modified: Dec 28, 2022 02:09 PM by Geatzo.)
PHP Code
<?php
$query9 = $db->prepare('SELECT * FROM categories WHERE takeawayid= ? ');
$query9->execute(array($_SESSION['id']));
// alternatively you could use PDOStatement::fetchAll() and get rid of the loop
// this is dependent upon the design of your app
foreach ($query9 as $row9) {
?>
<select name="country" class="form-control form-select form-select-lg select2" data-bs-placeholder="Select Country">
<option value="<?php echo $row9['cat_id']; ?>"name = "topic_cat"id="topic_cat" ><?php echo $row9['cat_name']; ?></option>
</select>
<?php } ?>
</div>
<input type="submit" class="btn btn-success my-1">
</form>
Im off course opening the form higher up and its outputting all the results into the drop down but when i submit the post the form is empty ?
Found the issue i called the select country higher up all fixed now

