calculated fields in mysql
Posted: Wed Apr 11, 2007 6:56 am
Hi,
I'm trying to create some basic customer account functionality (not enough to warrant an open-source shopping cart solution) and I was wondering if MySQL can have automtically calculated fields.
For instance for each customer account, if I have a few fields with the cost of the customer's purchased items and a few fields with payments the customer made, can I have a field in MySQL that will always contain the balance between the two stored in the database. That way whenever I want to echo or display the balance to the customer, I don't need to extract and then sum up and subtract the indidividual items in my php code.
MS Access easily allows for such functionality, so I assume MySQL has a similar feature.??
thanks
p
I'm trying to create some basic customer account functionality (not enough to warrant an open-source shopping cart solution) and I was wondering if MySQL can have automtically calculated fields.
For instance for each customer account, if I have a few fields with the cost of the customer's purchased items and a few fields with payments the customer made, can I have a field in MySQL that will always contain the balance between the two stored in the database. That way whenever I want to echo or display the balance to the customer, I don't need to extract and then sum up and subtract the indidividual items in my php code.
MS Access easily allows for such functionality, so I assume MySQL has a similar feature.??
thanks
p