in your database, make sure the promo.promoid and promodetails.promodetailid columns are both set to auto increment.
in the store order summary behavior, set the promo.promoid column as the key column (Sounds like this is already correct). Do not set a binding for the promo.promoid column, leave that unbound.
in the store order details behavior, set the Key Column to the promodetails.detailpromoid and bind thta column to the session created by the store order summary behaivor.
do not bind the promodetailid column to anything, let the database assign the value.
to clear the cart after the order is processed, add the following code to the checkout success page after the closing </body> tag:
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
@session_start();
// Unset all of the session variables.
$_SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
@setcookie(session_name(), '', time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
// Finally, destroy the session.
@session_destroy();
@session_regenerate_id();
?>