How to update database table when the same item is selected inside combobox

Aug 2 2017 8:52 AM
Am working on sales and inventory system where all items to be sold is stored inside a combobox. I have created a database with table_name TEMP_TABLE with column product_quantity,product_name,total_amount etc.where the information about a selected item inside the combobox is stored and this work successfully. My problem now is that when item is selected and the same item is selected again, it create a new row inside the table which I don't want. I want to do it in such a way that when item is selected and the same item is selected again, the previous data should be updated (e.g the product_quantity should be added with the previous product_quantity of the same product_name) since the selected item is of the same name. Please help me!

Answers (1)