phreeze
phreeze copied to clipboard
Required values not fire error message on save
I am generated a phreeze app with a database with some not null fields, I am using PDO as MySql Driver, In app generated, when I add a new record without fill any not null field in the database, the app save without problem an empty record.
What can I do to validate a not null fields in the app?
The controller file is what is doing that because for a web form it doesn't ever pass in NULL - it just passes in an empty string. So it's setting your columns to empty string and they are allowed to be inserted. You can handle it in various ways - you can put in validation code in the model, or the easy approach is to just check those values in the controller and throw an error if they're blank.