Forum Moderators: open
Background:
We have a small social networking site, that requires users to signup.
On the first form, they are only required to enter some basic information. i.e. Name, email address etc. Once submitted this information is stored in the database. They are then required to verify their account via email.
Once verified they can enter some more information about themselves.
The problem:
One of the fields in our database has been set to NOT NULL. However, this particular field is not present on the first stage of the signup process.
Therefore, No data or "" is entered into this field from the first stage.
Whats happening is the letter 'a' is being populated into this field.
I've looked through the code and cannot see how this is happening. The only thing I can think of is that the database is populating this data, as this field cannot be NULL.
Can anyone confirm this?
Please ask if you require more information.
Yes it seems it was a problem with application logic. In short this was happening:
$foo = add;
Further along in the script, I wanted the value of an array $foo['something']; because $foo['something']; didn't exist what was actually happening was the it was looking at $foo and taking the first value of the string which happens to be a.