hello I am trying to use the following code in Row_inserting event. But it does not work. Could someone please have look if I am doing correct things?
My Tables is reservations with following columns: Datum (date), Vom(time), Bis(time).
The content is:
(1) 21.02.2015 02:00 05:00
When I try to enter a new record for same day from 06:00 (Vom) to 11:00(Bis) then I am geting failure message..
// Row Inserting event
function Row_Inserting($rsold, &$rsnew) {
$MyResult = ew_Execute("SELECT * FROM reservations
WHERE".'"$rsnew[Vom]"'. "BETWEEN Vom AND Bis");
if (!empty($MyResult)){
$this->setFailureMessage("Sorry, There is A reservation.");
return FALSE;
}else{
return TRUE;
}
}
thanks
mpol_ch