php - the sum of entered number with old number in the database -
i have 3 fields , table in database called "support"
name:<input type="text" name="name" id="name" value=""/> <br><br> serial:<input type="text" name="badge" id="badge" value=""/> <br><br> quantity:<input type="text" name="address" id="address" value=""/> <br><br>
if name , serial exists in database (the quantity field) can sum of entered number old number in database. example, quantity 5 insert value 6 quantity 5+6= 11.
how can ?
you can use simple sql query after parameters $_post
:
update support set quantity = quantity + ? serial = ? , name = ? # passing escaped parameters form
first parameter $_post['address']
, second $_post['badge']
, third $_post['name']
Comments
Post a Comment