I have a food menu. Each area, like beverages, grill, etc. have items
under them, Coke, Tea, Coffee would be under beverages for example.
I want to add a new drink to beverages. In my database I have an
"area" like above, Bevs, Grill, Chicken... In my menu items I have an
ID from the area so,
table areas
id 1 areaname beverages
id 2 areaname grill
table menuitems
id 1 areaid 1 menuitem coke
id 2 areaid 1 menuitem sprite
id 3 areaid 2 menuitem hamburger
Now, in my form, I have the entire menu displayed with all areas and
menu items. In each area there is small set of textboxes to enter new
menuitems for that area with a button. Messy yes, but what I can't
figure out how to do is get the unique table area id for the new menu
item because when the user clicks submit it doesn't just send the
"name" across for that particular area addition. it sends all the
form elements over and since they are all named the same thing I have
tons of them and I don't know how to get just that unique id. I know
I've lost you. Let me try again.
In the display I have beverages and right underneath it has a textbox
for a new item and next to that a save button. Underneath this I have
grill and right underneath it has a textbox for a new itema and next
to that a save button and so on with ever area. These are generated
by a set of loops from my database.
Since all the textboxes have the same "name" attribute when I click
save I get many many identical attributes:
myprocessor.php ?id=3&item=coke &id=4&item=0... . I just get a
querystring with lots of blank variables. I know I must be doing
something to have this. All I really need is one ID. The ID from the
current area and that textbox only, but I can't since all the
generated elements are in between the same <formelement. Thank you.
under them, Coke, Tea, Coffee would be under beverages for example.
I want to add a new drink to beverages. In my database I have an
"area" like above, Bevs, Grill, Chicken... In my menu items I have an
ID from the area so,
table areas
id 1 areaname beverages
id 2 areaname grill
table menuitems
id 1 areaid 1 menuitem coke
id 2 areaid 1 menuitem sprite
id 3 areaid 2 menuitem hamburger
Now, in my form, I have the entire menu displayed with all areas and
menu items. In each area there is small set of textboxes to enter new
menuitems for that area with a button. Messy yes, but what I can't
figure out how to do is get the unique table area id for the new menu
item because when the user clicks submit it doesn't just send the
"name" across for that particular area addition. it sends all the
form elements over and since they are all named the same thing I have
tons of them and I don't know how to get just that unique id. I know
I've lost you. Let me try again.
In the display I have beverages and right underneath it has a textbox
for a new item and next to that a save button. Underneath this I have
grill and right underneath it has a textbox for a new itema and next
to that a save button and so on with ever area. These are generated
by a set of loops from my database.
Since all the textboxes have the same "name" attribute when I click
save I get many many identical attributes:
myprocessor.php ?id=3&item=coke &id=4&item=0... . I just get a
querystring with lots of blank variables. I know I must be doing
something to have this. All I really need is one ID. The ID from the
current area and that textbox only, but I can't since all the
generated elements are in between the same <formelement. Thank you.
Comment