Use the eCart checkout wizard to create the checkout pages for you.
as long as you have a database connection configured before running the wizard, you will be able to configure the checkout pages to store the order information to the database within the wizard.