This topic is locked

simple maths betwwen 2 entries

6/2/2009 7:52:15 AM
PHPRunner General questions
F
fabriceaka author

Hi,
sorry for the total newby question but I am total a newbie in both PHPrunner and databases... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=11967&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />

Anyway... here we go :
I have a tables with 3 entries : start, end , lentgh. Both 3 are intergers.

I'd like the 3rd entry to be "read only" and be calculated automatically:

length = (end - start) + 1
I don't understand if that kind of stuff should be done in the "Query Editor" page or in the "Visual Editor"...
I run with MySQL.
Thanks in advance,

F.

J
Jane 6/2/2009

Hi,
use Before record added/Before record updated events on the Events tab for this purpose.

Here is a sample:

$values["length"] = $values["end"] - $values["start"] + 1;

F
fabriceaka author 6/2/2009

Fantastic.

Thanks very much
F.