Whereas will be Final price, in other words calculated column per each row, how achie

how in mysql

when query in Rent a car Proj
prices and cars tables - same rows
I want json output to client script merged of the two tables (done till now) plus a column custom, whereas will be Final price, in other words calculated column per each row, how achieve the calculated column along with rest columns output all with json_encode in PHP and ajax to jQuery…?

Could you please post a data example, and the query code you’ve got so far?
Your explanation isn’t very clear (to me).

the matter is general, how with two or three columns (in each row) calculate a new on the fly column and eject it from php/mysql to jQuery ajax… basically tell only mysql query customcolumn(to be added to result set)=col1 * col2
well?


SELECT
    columnname1
  , columnname2
  , ...
  , col1 * col2 AS calculatedcolumn
FROM ....
WHERE ...

Just add the calculation in your select clause, give it an alias, and it will appear in your query result set. It all depends on your PHP and JS code what else you’ll have to modify.