Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<td>
        <h4>To view discounts, simply select from a category below.</h4><br />
        <!-- List Category Box -->

        <?php
        $db = new mysqli('50.62.209.81:3306','user','password','MassWarVetsADM');
        $query="SELECT Category FROM Category";
        $result = mysql_query ($query);
        echo "<select name='categoriesSelect' class='e1'><option value='0'>Please Select A Category</option>";

        // printing the list box select command
        while($categoryinfo=mysql_fetch_array($result)){//Array or records stored in $nt
        echo "<option value=\"".htmlspecialchars($categoryinfo['category'])."\">".$categoryinfo['category']."</option>";
        }
        echo"</select>";
        ?>


When I look at my page in firefox I get this: http://i62.tinypic.com/2eqc22v.png[^]

I removed the username&pw for security reasons. What am I doing wrong?

This should print the business categories listed in the "Category" column within the "Category" table inside the "MassWarVetsADM" database inside a select box. There is about 30 categories.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900