i stored few values through input form. (for example tax and rate field) if i entered tax = 777.77 and rate = 10000 it stored the details to db successfully. retrieve function also done successfully. but i want to show add these two values(tax+rate = total) from db when i am retrieved these values? i tried few methods. but its not working. how to do that?

Recommended Answers

All 2 Replies

select tax+rate as total from table

Member Avatar for diafol

You can either do it in MySQL or in PHP

MySQL method:

SELECT ..., tax + rate AS MyTotal FROM table...

Useful if you want to sort records by MyTotal

I hope the PHP method is obvious - you calculate this in your recordset loop

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.