Gossamer Forum
Home : Products : DBMan SQL : Discussion :

NULL not an empty string

Quote Reply
NULL not an empty string
I'm having a hard time getting an INT (that can be NULL, in MySQL) to persist as NULL. Dbsql seems to want to replace it with a "0" in modify_record.

The HTML form has this item as a text input, and when the user leaves the field blank, CGI seems to bring it in as a null string (eq '') rather than undef. I had to stick a hack in my existing modify_record pre-plugin to recognize this particular CGI variable name (diskquotaMB) and force it =undef if it's eq '' before falling through. That seems to do the trick but: Wow. I really hope there's a cleaner answer to this.

This is DBManSQL v2.1.0. (I've been developing this thing for quite some time.) Is this fixed in a later version, perhaps? Gossamer Forum rocks (I plan to buy it soon), but searching for NULL didn't turn up any clear answer this time.
Subject Author Views Date
Post NULL not an empty string jxh 1769 Jan 22, 2005, 9:41 PM