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

sql - Time in datatime field -

javascript - How to split the success output from an Ajax post? -

java - sharing object across different classes -