<?php $select_query= "Select category from books"; $select_query_run = mysql_query($select_query); $select_query_array= mysql_fetch_array($select_query_run) ; $cat = $select_query_array['category']; echo "<select name='category'>"; while ($select_query_array= mysql_fetch_array($select_query_run) ) { echo "<option value='' >".htmlspecialchars($select_query_array["category"])."</option>"; } echo "</select>"; ?>
SQL SELECT DISTINCT Statement
Select distinct category from books
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)