how to register one purchasing order common to many rows filled

Status
Not open for further replies.

radvla

Member
This is basicly the problem:

1?) I have created a table the include the information of several products attributes and their identification.

2?)Iin the table there is a field call order_Number that represents the sequencial number of orders received in the web.

2?)Uuser open a session and fills several rows of this table so as creating a purchasing order, that includes one product for each row. To each row correspond one additional record in the table/database.

4?) when he finnish the sesion I want that the "order_number" is automaticly increased by one unit and this number is registered on all records that the user has generated and composed the order.

How can I do it?

thank you ver much indeed.

radvla
 
I think you would be better creating two lists: orders and order_items, below is an idea of the fields you might want to add to each list

Code:
+---------------------+
| orders                      |
+---------------------+
| id                             |
| user_id                    |
| date_created           |
+---------------------+
 
+---------------------+
| order_items            |
+---------------------+
| id                             |
| order_id                  |
| product_id              |
| quantity                  |
+---------------------+

Then edit the orders table and in data->joins add a join:

Code:
left join order_items ON id = order_id

thus when you go to orders and add an order, you will be able to add multiple order items to the order and Fabrik deals with the relationship between orders.id and order_items.order_id for you
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top