Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $query = "SELECT `menu_id`, `menu_name` FROM main_menu";
- if ($result = mysqli_query($conn,$query)) { // execute the rest of script only when query is executed successfully
- if (mysqli_num_rows($result) > 0) { // successfully executed query doesn't mean you must get the result
- WHILE ($row = mysqli_fetch_assoc($result)) {
- // use echo instead of mixing html and script (easier to manage and easier to comment out
- echo '<option value = "'.$num['menu_id'].'">'.$num['menu_name'].'</option>';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement