This topic is locked
[SOLVED]

 Field custom or before record added?

2/28/2012 8:12:06 AM
PHPRunner General questions
E
epanc author

Hi,

I have a table with the following fields:

id

revenue

description

fabb
the field "description" can have different values​​:

val1

val2

val3

Val4
Then the field "fabb" should automatically have the value "1" if "description" = val1 or val2 or val3, "0" in all other cases.

Thank you!

C
cgphp 2/28/2012

Check the PHPrunner manual, there are a lot of examples: http://xlinesoft.com/phprunner/docs/ctrl_setvalue.htm

E
epanc author 2/28/2012

Thanks Cristian,
unfortunately know very little javascript.

I read the aritcolo that you suggested but was not able to adapt the code to my needs. Can you give me a help?

Thank you.

E
epanc author 3/1/2012

ok, I solved it by "table events" - "list page: before process" as follows:
function BeforeProcessList($conn)

{

$sql = "UPDATE mytable SET revenu= 1 WHERE description= 'val1' OR description='val2' OR description='val3' OR description='val4'";

CustomQuery($sql);
Thanks.