Question
MySQL Not Null not working as I expect
Hi,
I've created a form to try and stop some autobot spamming that has been occuring.
I have created a dropdown option field where the person filling out the form has to choose the second option which is like:
1. I am a computer
2. I am a Human.
The default option is 1, and using Yaromats extension, I have set it so that the first option is not correct and will return and error etc.
This all works fine.
The field in the MySQL database that gets populated by the choice is called comments_Secure.
I have set it that the field is "Not Null", which, in my understanding means that the entry will not be accepted unless the field is populated, a bit like the Primary key field but is set to auto-increment so that is will automatically be filled.
However, if I do not choose the correct option in the drop down menu on the Form page, then indeed I get the error to choose the correct option or I cannot submit the form.
This seems to be somewhat different to the way the autobot spam works, because I have found that it will still create an entry in the database, but the comment_Secure filed is empty and not populated, but the MySQL database seems to accept this.
If I fill out an entry directly in phpMyAdmin, it too accepts the entry even if I do not populate the comment_secure field.
What am I overlooking here please?
Can you please explain how to set it up so that the comment_Secure field has to have text inserted or the entry is not accepted???
cheers
I've created a form to try and stop some autobot spamming that has been occuring.
I have created a dropdown option field where the person filling out the form has to choose the second option which is like:
1. I am a computer
2. I am a Human.
The default option is 1, and using Yaromats extension, I have set it so that the first option is not correct and will return and error etc.
This all works fine.
The field in the MySQL database that gets populated by the choice is called comments_Secure.
I have set it that the field is "Not Null", which, in my understanding means that the entry will not be accepted unless the field is populated, a bit like the Primary key field but is set to auto-increment so that is will automatically be filled.
However, if I do not choose the correct option in the drop down menu on the Form page, then indeed I get the error to choose the correct option or I cannot submit the form.
This seems to be somewhat different to the way the autobot spam works, because I have found that it will still create an entry in the database, but the comment_Secure filed is empty and not populated, but the MySQL database seems to accept this.
If I fill out an entry directly in phpMyAdmin, it too accepts the entry even if I do not populate the comment_secure field.
What am I overlooking here please?
Can you please explain how to set it up so that the comment_Secure field has to have text inserted or the entry is not accepted???
cheers
