This topic is locked

How display a calculate field in a page list.

10/30/2007 3:01:21 AM
PHPRunner General questions
E
elomor author

Hi, i'm new in the PHPRunner,

I think that it's a very good aplication but i can't solve a problem.
I want that in a page list show one field that is the result of sum two fields, how can i do?
I don't find the event that i have to use.
My table has three fields: name, price, tax.

I want to do a list page that shows name, price, tax, price+tax.
Please can you help me.
Thanks!!

J
Jane 10/30/2007

Hi,
you can do it using calculated fields on the Edit SQL query tab in the PHPRunner.

Here is a sample:

select name,

price,

tax,

price+tax as total

from TableName

E
elomor author 10/30/2007

Hi, Jane, thanks but my problem is that i don't want calcule the field in the sql query,

I want calculate the field in the page list.
But the event's function don't have the fields parameters.
I want to do this:
function NEW_xxx_Event1(&$params)

{
echo $field1+$field2;
}
But i can't do this because the $params not content the fields of table.
Can you help me please!

Sergey Kornilov admin 10/30/2007

You need to explain what page you talking about and where you like to place the result.
Btw, Jane's suggestion will work just fine for you.