Hi all:
I use a software (phpmaker) to create php crud pages over a database. I think it's quite easy and powerfull (I use just a little part of its possibilities, just like with B4X). It reads your database, and you can create the add, edit, update pages based in user permissions, etc... and it has a lot of events you can use to customize the behaviour.
When you update a field, you rise a Row_Updating event, where you can check some things and change values, etc... The default function just returns TRUE, so the database is updated.
The parameters of the function are the old values of the form, and the new ones.
Well, I edit a field in a modal page, so when I close the modal, I don't get the SuccessMessage or FailureMessage (it's shown in the modal, and after the update the modal is automatically closed)
So, to debug, I set the FailureMessage to show the new and the old value of my field, and return FALSE just to keep the modal opened and see the message.
In my laptop, if I delete the value of the field "proyecto", the value is "deleted" (I mean, set to '') in my database. But in my server (VPS server with UBUNTU, mariadb and nginx) the old value remains. If I change the value for another one, is changed, but if delete the EditText value, the old value is not changed.
In both databases (my laptop and my server) "proyecto" field is set up the same way, and it allows NULL values. There's not javascript in my page to change the field before the post.
As it's said: "a picture is worth a thousand words"
This is the expected behaviour, in my laptop
This is the problem, in my server:
As you can see, if I delete the field, it has no effect.
Thanks for reading to the end
The original post:
www.hkvforums.com
P.S.: I know... someday I will learn ABMaterial or BANANO and I will change my php page...
I use a software (phpmaker) to create php crud pages over a database. I think it's quite easy and powerfull (I use just a little part of its possibilities, just like with B4X). It reads your database, and you can create the add, edit, update pages based in user permissions, etc... and it has a lot of events you can use to customize the behaviour.
When you update a field, you rise a Row_Updating event, where you can check some things and change values, etc... The default function just returns TRUE, so the database is updated.
The parameters of the function are the old values of the form, and the new ones.
Well, I edit a field in a modal page, so when I close the modal, I don't get the SuccessMessage or FailureMessage (it's shown in the modal, and after the update the modal is automatically closed)
So, to debug, I set the FailureMessage to show the new and the old value of my field, and return FALSE just to keep the modal opened and see the message.
B4X:
function Row_Updating($rsold, &$rsnew) {
$this->setFailureMessage("new: " . $rsnew['proyecto'] . " old: " . $rsold['proyecto']);
return FALSE;
}
In my laptop, if I delete the value of the field "proyecto", the value is "deleted" (I mean, set to '') in my database. But in my server (VPS server with UBUNTU, mariadb and nginx) the old value remains. If I change the value for another one, is changed, but if delete the EditText value, the old value is not changed.
In both databases (my laptop and my server) "proyecto" field is set up the same way, and it allows NULL values. There's not javascript in my page to change the field before the post.
As it's said: "a picture is worth a thousand words"
This is the expected behaviour, in my laptop
This is the problem, in my server:
As you can see, if I delete the field, it has no effect.
Thanks for reading to the end
The original post:

Updating a field with a blank value not working (v2019)
Hi all:I have in my row_updating event in a modal edit page: function Row_Updating($rsold, &$rsnew) { $this->setMessage("$rsnew: " . $rsnew["myfield"]); $this->setMessage("$rsold : " . $rsold["myfield"]); return FALSE; //return false to see the messages in the modal. If I return...

P.S.: I know... someday I will learn ABMaterial or BANANO and I will change my php page...