Gossamer Forum
Home : Products : DBMan : Customization :

store zero in database

Quote Reply
store zero in database
I thought i saw a post somewhere about forcing dbman to store the number zero in a database. i have a numeric field that is required, but zero is a valid entry. negative numbers are not. only positive integers and zero. dbman changes zero to blank and stores empty field. i am using file upload mod and have read that may be causing problem? can someone point me in right direction? thanks
Quote Reply
Re: [delicia] store zero in database In reply to
I did some searching and I think I found the answer.

http://www.gossamer-threads.com/...orum.cgi?post=241703 says

Quote:

I think you should replace your
unless ($value) { next PAIR; }
with
unless ( length ($value) ) { next PAIR; }


This would be in sub parse_form.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Quote Reply
Re: [JPDeni] store zero in database In reply to
that makes sense. should there be a space between length and ($value) ?
Quote Reply
Re: [delicia] store zero in database In reply to
I don't think it matters. It seems to compile either way.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.