you should have 2 database tables:
your order details table should have a foreign key column that will create a relations ship between the order table and the order detail table
you should use the eCart Store order Summary to store the customer information into the order table. In the Store order summary set the key Column to the be the Primary key column of the order table. make not of the name of the store as value.
Use the eCart Store Order Details to store the order details information.
Set the key column to the Foriegn key column of the order details table.
see the creating an order history tutorial on the eCart support page.