php - Increasing database field by specified percentage -


i have product information stored in mysql database. "price" column in database contains numeric price.

i need write function in php can go through values , increase them specified percentage, not sure proper way go it. there function in mysql can it, or prices need read database, modified, , written database?

the appropriate sql is:

update t     set price = price * (1 + $percentage / 100); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -