Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getCategories($id = null) {
- $categoried = array();
- $query = mysql_query("SELECT id,name FROM `categories`");
- while ($row = mysql_fetch_assoc($query) ) {
- $categories [] = $row;
- }
- ...
- <select name="category">
- <?php
- foreach(getCategories() as $category){
- ?>
- <option value=" <?php echo $category['id'];?> " > <?php echo $category['name'];?> </option>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement