Control if row exists in mysql db?

Hi any way to control the following use case?

i got this table

product_id should be unique so i got a form like this


when i submit the first time it should create the record with the unique product_id. then the other submit it should only update the qty_available field in db plus inserting to 2 other tables.

i tried the following without luck

how i can achieve that?

example of my working laravel app: Loom | Free Screen & Video Recording Software | Loom

thank you

Hey @agaitan026!

Are you getting an error message, or is something happening with your database that you don't expect? Would you mind sharing the result of running the query?

1 Like

i just created another way to manage this with one query

easier and faster when i create product, user may input the initial stock

thanks