Dynamically generate radio buttons and insert into lookuptbl

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
laknal
Forum Newbie
Posts: 21
Joined: Wed Oct 11, 2006 7:38 pm

Dynamically generate radio buttons and insert into lookuptbl

Post by laknal »

I am new to php. I need some to get desired functionality.

I have three tables:

Order Table:

1. Order_id

2. Order details

Product Table:

1. product_id

2. product_name

order_product table:

1. order_product_id

2. order_id

3. product_id

Requirement:

1. when user places order, order_id is inserted into order table and order_product table

2. All products are displayed with 'yes' and 'no' radio buttons.

3. Its mandatory to select either 'yes' or 'no' radio button for each product.

4. All product_ids are entered into order_product table for that particular order_id.

Example:

order_product table:

order_product _id=1

order_id=1

product_id=1

order_product _id=2

order_id=1

product_id=2

order_product _id=3

order_id=1

product_id=3

OR

order_product _id=1

order_id=1

product_id=1,2,3

I unable to insert more than one product into the order_product table.
If change my product table, so that each product has its column, then I was able to generate radio buttons:'yes' and 'no' for each product.

Any help is appreciated.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Not following, can you explain a bit more. Where's your PHP code?
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

I need some to get desired
Me and you both but we won't find any on programming forums now will we? :P:D
Post Reply