How to perform Mathematical operations in Mysql through php and Mysql? -


i new mysql , have faced problem while learning:- created table named "x" in mysql 10 columns , wrote code in php enter data table form in first 8 columns of table , in column 9 need value obtained after performing mathematical operation on value in column 2. instance, have marks every student in column 2 of table , in column 9, need percentage (considering total marks constant). how can percentage in column 9 , update on every row of column 9? remember table in database in mysql.

before inserting value column, make sure perform necessary calculation on incoming value.

e.g

$column2 = $_post['column2_field'];  $calculation = $column2 * 50/100 //50 percent 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -