This topic is locked
[SOLVED]

check the value of a record

3/8/2022 8:48:30 AM
PHPRunner General questions
J
Jan author

Hey,
Before I add a record to a table, I first want to check if the value of a certain field has not been exceeded. I write this code in the event "before record added".

$int_value = 60;
if ($values['age'] >= $int_value) {
???????????????
}

What code do I need to complete so that the record is not added to the table? thanks

aadham 3/8/2022

Depends on what you want the code to do but, for instance, if it's meant to warn the user here's a sample code for that:

$int_value = 60;
if ($values['age'] >= $int_value) {
$message = "Age is over 60!";
return false;
}
else
{
return true;
}

Hope this helps

J
Jan author 3/8/2022

thanks !