Results 1 to 20 of 20
Thread: What to store for Blank Fields?
Jun 30, 2012, 13:18 #1
- Join Date
- Aug 2010
- 2 Post(s)
- 0 Thread(s)
What to store for Blank Fields?
When a user leaves a Form Input Box or Text Area blank, what should I store in my database?
Conventional wisdom would say a NULL since they never - in this scenario - filled out the field.
I believe that for Inputs and TextAreas, HTML inserts an Empty String into the $_POST array, so by default you would be writing Empty Strings into your database.
Right now I am checking all of my Form Validation, and I want my PHP to insert the *proper* data-type into fields whether that should be a NULL, Empty String, or 0.