yes, you need to use a database to store the order at checkout time.
you do not need to use a database on the product pages.
only the confirm page will connect to the database.
to use a database, you need to have a connection to the mysql server.
the order information will be stored in the database on the mysql server.