What if I set up a database table for an ad form that has optional fields. Do i need to select anything when creating rows for these fields other then the type?
luke.belleghem 0 Newbie Poster
Recommended Answers
Jump to PostIf the fields are optional that is fine. In general regardless of the SQL implementation, you would set the corret data type and allow for NULL values to be stored in the event that no data is inserted in the particular field for the record.
Jump to PostI beleive that for MySQL, the column allows for null values unless you specified not to allow (not NULL) null values when you create the table. If you did set it to not allow null values, you simple can use the alter statement to modify the field to allow null …
Jump to PostIf you are willing to let people leave a box empty/field on the form, then you can do either default null or select the null checkbox!
Both will give the same result.If you check the not null box, it will fail to store the empty / null value that …
All 9 Replies

LastMitch
JorgeM 958 Problem Solver Team Colleague Featured Poster
luke.belleghem 0 Newbie Poster
JorgeM 958 Problem Solver Team Colleague Featured Poster
luke.belleghem 0 Newbie Poster

LastMitch
luke.belleghem 0 Newbie Poster

LastMitch
drjohn 56 Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.