Hi all. I am new user here and I found a lot of usefull info in this board. What I am curious to learn is how can I update a record in MySQL and in the same time to Insert a new record in another table. For example, I have a table called ORDERS and users choose an order and offer price for it. When he offers a price, the query updates the BID and USER_LAST fields in the ORDERS table. What I want is with the same query, also to INSERT the Order ID, name of the user and his bid into other table, where will be storet the full history of the bidding. So for example User1 offers 20, the Orders table updates to bid=20 user_last=user1. When user2 bids 22 the orders table updates to bid=22 user_last=user2. I want to have both the user1's and user2's bid written in another table called BIDS, so I can review who has bided and how much. Thanks a lot for you attention and hopefully I will get the answer :) Thanks.
Jump to Post
you need to add both the insert and update queries into a procedure and call the same from front end application.
All 15 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.