Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

Condition

$
0
0
I have a table with total of 5 fields with one out of the 5 is an Alias field

SELECT
actor_id,
TaskStartTime,
TaskEndTime,
unit,
(TIMEDIFF(TaskEndTime,TaskStartTime)) AS `Time`
FROM actor

As you can see I am doing a time diff calculation which is working find providing elapse time. The problem I me having is trying to use the result from the calculation and run a condition check against it with an Event Before Record Update with following code.,but unfortunately the below code doesn't work

if ($values["Time"]<= "00:07:00")
$values["Unit"]="0";

else

if ($values["Time"]>= "00:08:00")
$values["Unit"]="1";

so if the minuets is less equal to 7 I would like to place a 0 in the unit Field or if it's Greater equal to 8 place 1 in the Unit field
Please let me know what I am doing wrong. Thanks

I am using Ver 9.6 of PHPRunner

Viewing all articles
Browse latest Browse all 2586

Trending Articles