Gossamer Forum
Home : Products : DBMan : Customization :

1 in to yes !

Quote Reply
1 in to yes !
to save space in my database i set up the yes/no questions to = 1 (for yes) or 0 (for no) how do get dbman to write out "yes" for 1 and "no" for a 0
Quote Reply
Re: [citybizz] 1 in to yes ! In reply to
You mean you have a field in your database which contains "1" for "yes" and "0" for "no" and want dbman to print out "yes"/"no" in search results?

Then you could add to the beginning of html_record, after the line "my %rec = @_":

$rec{'field_name'} =~ s/1/yes/;
$rec{'field_name'} =~ s/0/no/;

....

print "$rec{'field_name'}";

With "field_name" being the name of the field that holds "1" or "0".



kellner
Quote Reply
Re: [kellner] 1 in to yes ! In reply to
You can just do:

print $rec{'field_name'};

I know , I know......being picky.
Quote Reply
Re: [RedRum] 1 in to yes ! In reply to
Well, assuming that more html code will go into the print code, quotes would be nice, wouldn't they. :-)

Last edited by:

kellner: Oct 13, 2001, 4:52 PM
Quote Reply
Re: [kellner] 1 in to yes ! In reply to
print $rec{'field_name'} . "blaaaa";

....but as there was no html then I thought I'd point out that " " weren't needed Cool
Quote Reply
Re: [RedRum] 1 in to yes ! In reply to
Yes, I know it's difficult to fathom that people add some seemingly unnecessary code because they think something *might* exist even though it doesn't at the moment. Sly
kellner
Quote Reply
Re: [kellner] 1 in to yes ! In reply to
once again thank you so much