the gift card should not be added to the database at the same time it is added to the cart. What happens if they add the item to the cart, but dont check out? Now you have an gift card that was not actually paid for.
let eCart handle this for you.
eCart will automatically add the order and order details info to the orders and order details table, the gift card item will be added to the order details table.
for the Price, from to and message, set up from, to and message columns in the cart,
in the add to cart button, make those column editable from a text box along with the price.