troubleshooting Question

Null or Not Null in MYSQL?

Avatar of dsellers99
dsellers99 asked on
PHPAdobe DreamweaverMySQL Server
10 Comments1 Solution441 ViewsLast Modified:
I have a php site I built in dreamweaver. I've been struggling with this newbie question - I have a form that submits into a MYSQL database. Most of the text fields on the form are required (I have validation rules on them). But some of the form text fields don't need to be required, so there is no validation in them. But when the form is submitted, I get the error message:

Error:
SQL error: Column 'my_field' cannot be null.

I went into the insert record wizard and set a default value for the fields that are optional (that aren't required), but I still get the error message. Should I go into the database and chnage the value from NOT NULL to NULL? Should I take the default value out or leave it in? Thanks for any suggestions.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros