Storing temporary data to array then transferring it to database

I have a table in a database that stores time in and time out of an employee for a certain date. I have a program that determines it, but I don't save it into the database until the user decides to finalize it.

Do you have any recommendation on how to temporarily store that data? I am currently thinking of storing it in an array then looping a query inside to write the data permanently once it is finalized.

Or shall I use a temporary table in the database?

Or is there another / better recommendation for this?