RE: Drop down menu with PHP

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

 



Hi Charles,

If you mean columns when you say rows the answer is no. When you mean rows
when your saying rows the answer is yes. That's what you are doing with your
code below.

Rolf

///////////////////////////////////////////////
/   Suicidal twin kills sister by mistake!    /
///////////////////////////////////////////////

-----Oorspronkelijk bericht-----
Van: The Image Builder [mailto:tibuildr@xxxxxxxxxxx]
Verzonden: maandag 5 april 2004 4:01
Aan: php-db@xxxxxxxxxxxxx
Onderwerp: Drop down menu with PHP


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