NOT NULL

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
vladsn07
User
Posts: 13

NOT NULL

Post by vladsn07 »

How to set the value blank when deleting data, now the value is set to NULL? The attribute of the field is not NULL.
Failed to execute SQL: UPDATE [dbo]. [We_computers_all] SET [FriendlyName] = NULL, [Description] = NULL ...


yinsw
User
Posts: 148
Location: Penang, Malaysia

Post by yinsw »

That is your database design problem. If you allow the field to be empty or blank, it should not be set as NOT NULL.

By right, PHPMaker will set the NOT NULL fields as a required so you should not be able to save it as NULL. There is a setting in Tools -> Advanced Settings -> Validate NOT NULL fields.


vladsn07
User
Posts: 13

Post by vladsn07 »

It does not help, I need to insert a null in the field, but an empty value. Now if you delete the value, the value NULL appears


yinsw
User
Posts: 148
Location: Penang, Malaysia

Post by yinsw »

Maybe you have to do your checking in row_updating. Try this if it works?

if (!isset(rsnew["YOURVARIABLE"])){
$rsnew["YOURVARIABLE"] = "";
}


vladsn07
User
Posts: 13

Post by vladsn07 »

Has changed a little:
If (! Isset ($ rsnew ["YOURVARIABLE"]))) {
Everything works fine, thanks.


Post Reply