Posted by Jon Slaughter on 06/14/07 23:57
"jsd219" <info@musiclanerecording.com> wrote in message
news:1181863278.221161.148450@q19g2000prn.googlegroups.com...
>I am going crazy over here. here is my code:
>
> $query = "SELECT SEC_TITLE, SEC_ID
> FROM section
> WHERE SEC_TITLE != ''";
>
> $result = mysql_query($query);
>
> echo "<form action='#'>\r\n<select name='id'>";
> while ($line = mysql_fetch_array($result, MYSQL_NUM)) {
> $section = $line[0];
> $id = $line[1];
>
> //echo " <option value=$section>$section\r\n";
>
> echo " <option value='$id'>$section</option>\n";
>
> }
>
> I need to pull both a name=id & name=section. and then send both via
> the option value. What this does is it pulls all the section titles
> for the table section and places them into a drop down box, when you
> select one of the sections and send the form it places that section
> title in the section field of the category table. i need it to not
> only send the section title but also the section id to the id field of
> the category table.
>
> I am at a complete loss, Please someone help me
>
I can't make out what your talking about but maybe passing id and section in
the option value might work?
i.e., use something like $id.$seperator.$section? and then parse when you
get it
Jon
[Back to original message]
|