Hi I have three two tables that store the information of what a person is buying, a shopping cart (Iam working with sql server and PHP).
tables:
the first table is:
pedido
* pedido_id
-cliente_id
-fecha
-total
-procesado
in this table I store particular information
and it has a relation of one to many with the table:
detalle_pedido
pedido_id
producto_id
-cantidad
-precio
how can I make a trigger that when an insert occurs in the table pedido it calls a stored procedure that inserts into detalle_pedido the details of the purchase and it is also transacctional.
by the way all the information is recalled from a session $SESSION['details'] and of course all details are like this:
$SESSION['details']['cliente_id']
$_SESSION['details']['fecha']
pedido_id si generated automtically when it is insertted a new record
pedido_id (auto_incremnet)