inserting one new record in table A and update table B
Dear Sir:
I have a question to ask about phpmaker.
I created a small trophy inventory system for my class.
All the trophies are maintained in table called "trophy".
There is another table called " transaction" to keep the records of borrow-and-return.
I need to insert one transaction record and update the trophy status at the same time to avoid data inocngruence.
Every trophy has a trophyID.
While inserting a record into the transaction table, users can use ajax to fast select the record to be used.
So the codes are as follows:
( actually no idea where will be the best place to put, server or client side?)
$("input[name='x_TrophyID']").change(function () {
var selection = $(this).val();
UPDATE trophy
SET Status
= 1 where UID = selection
});
Any help appreciated.