This topic is locked
[SOLVED]

 Help for Record Check

2/3/2010 6:58:28 AM
PHPRunner General questions
S
sickacid author

Hi i've do this code in the Before Record added,

When i add a record, if $Kmp > 2500 i'want to get

an error, else if $Kmp i want to write something in the table...

This code works, it don't write nothing in the table if $Kmp is >2500

and if $Kmp is <2500 it writes what i want in the table, but

with this code i'cant have classic error in red (for example when

a field is required) in the top of page.
What i can do?
$KmP = $values["KmFine"]- $values["KmInizio"];
if ($KmP < 2500)

{

$values["KmPercorsi"] = $values["KmFine"]- $values["KmInizio"];

$values["OreLavorate"] = $values["OreLavorate"];

$values["LastUser"]=$_SESSION["UserID"];

return true;

}

else

{

return false;

}

J
Jane 2/3/2010

Hi,
here is a sample:

$KmP = $values["KmFine"]- $values["KmInizio"];
if ($KmP < 2500)

{

$values["KmPercorsi"] = $values["KmFine"]- $values["KmInizio"];

$values["OreLavorate"] = $values["OreLavorate"];

$values["LastUser"]=$_SESSION["UserID"];

return true;

}

else

{

**$message = "<div class=message>Your error message here</div>";**

return false;

}