Posted by ZeldorBlat on 06/14/07 17:31
On Jun 14, 12:23 pm, jsd219 <i...@musiclanerecording.com> wrote:
> here is my code:
>
> $query = "SELECT SEC_TITLE
> FROM section
> WHERE SEC_TITLE != ''";
>
> $result = mysql_query($query);
>
> echo "<form action='#'>\r\n<select name='section'>\r\n";
> while ($row = mysql_fetch_array($result, MYSQL_NUM))
> {
> echo " <option value='{$section[0]}'>$row[0]\r\n";
>
> }
>
> It works great but I need it to also select the ID from the section
> table without displaying it. so the client only sees a drop down box
> with the section titles but when they select one and send the form it
> will send both the section title and sec id
>
> I have tried changing the SELECT SEC_TITLE to SELECT SEC_TITLE, SEC_ID
> but i am lost from there.
>
> Anyone please :-)
>
> God bless
> jason
Change your query as you described above, then replace section[0] (not
sure what that was anyway) with row[1].
[Back to original message]
|