In order to make calculations and logical operations,
scripts have been written both in PHP and SQL in order
to use MySQL mathematical functions. That means an
increase in performance. For instance, these are the steps
to follow when multiplying and storing the result of two
records, A and B, which belong to the same table. Using
only PHP code: