Drop down menu with PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have code for a drop down menu that works fine.  But, though I only want
the results from one row to fill the form, I want it to show 2 rows in the
drop down menu.  Can I do that? I would appreciate your help.  Here is what
I have now:

<? mysql_connect("localhost","user","password");
    mysql_select_db("database");
    $sql = "select distinct category from books ORDER BY category ASC";
    $makes_result = mysql_query($sql);
    print ("<select name=\"category\">\n");
    print("<option selected value=\"\">Please select a
Category</option>\n");
    while($row = mysql_fetch_row($makes_result))
    {
    print("<option value=\"$row[0]\">$row[0]</option>\n");
    }
    print("</select>"); ?>

Thanks in advance
   Charles

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux