I have many forms that I am serializing. The data is posted to either an insert.php page or update.php.
If a form input is left blank, I want to insert a NULL value into my database. I'm using mySQL.
It seems like when a form is serialized, any fields that are left blank are sent as value of '' which does NOT insert as NULL into my db.
I can filter out empty inputs before serializing, but this isn't good when a record needs to be updated.
Here's a fiddle of a form that you can at least see that empty inputs are logged as "".
Any advice on how I can set those values to NULL instead?
jsfiddle.net/gabrieleromanato/bynaK/