When you display your items in the table, include the item_id in the query string:
<a href='add_to_cart.php?item_id=4'>Add To Cart</a>
Depending on how you set up your cart, you might want to keep track of (at a minimum) session_id, item_id, and quantity.