Generally, the verification rules are written as follows: {code ...} if the fourth parameter is 0, it indicates that the repassword Column exists in the database, it will be verified, but the code written by myself does not know whether the Column exists in the database? If this column is not found, isn't there much Remainder of the validation rules? If you have this... the General validation rules are as follows:
// Verify that the password is consistent with the password array ('repassword', 'Password', 'confirm that the password is incorrect. ', 0, 'Confirm '),
If the fourth parameter is 0, it indicates that the repassword Column exists in the database, it will be verified, but the code written by myself does not know whether the Column exists in the database?
If this column is not found, isn't there much Remainder of the validation rules?
If this column exists, is it better to directly write 1 (verification required) as the parameter?
Another question is: do we need to store two identical passwords for the same user name in the database?
Reply content:
Generally, the verification rules are written as follows:
// Verify that the password is consistent with the password array ('repassword', 'Password', 'confirm that the password is incorrect. ', 0, 'Confirm '),
If the fourth parameter is 0, it indicates that the repassword Column exists in the database, it will be verified, but the code written by myself does not know whether the Column exists in the database?
If this column is not found, isn't there much Remainder of the validation rules?
If this column exists, is it better to directly write 1 (verification required) as the parameter?
Another question is: do we need to store two identical passwords for the same user name in the database?
The confirm field is not used for your database.
Generally, when a user registers or modifies a password, the user is allowed to enter the password twice.
The first is the password set by the user, and the second is the Password confirmed by the user.
The function of confirm is to verify whether the two fields in the form are the same
The 4th parameters have three optional values:
If the Model: EXISTS_VALIDATE or 0 field exists, it is verified (default) When Model: MUST_VALIDATE or 1 must be verified when Model: VALUE_VALIDATE or 2 is not null.
The existing field is not the data inventory field, but the name value of the control in the form. It is not the same concept as the field in the database.
By default, the control with the name value in the form is verified.