in reply to Re: How to implement a checkbox that will send data to db
in thread How to implement a checkbox that will send data to db
# get Discontinued my $sql = qq!SELECT DISTINCT("Discontinued") AS disc FROM "Products" ORDER BY 1 DESC !; my $dr = $dbh->selectall_arrayref($sql); # Make up a pulldown menu for Discontinued my $discs = qq!<option value="">Select option</option>!; for my $row (@$dr) { $discs .= qq!<option value="$row->[0]">$row->[0]</option>\n!; }
But if I select 1 i.e. True the update goes through and if select 0 i.e. False it sends a null value which is throwing the following error :Discontinued :<select name="discontinued"> $discs </select><br/>
Any I idea why it will send 1 but not 0 ? Many Thanks Rgds TerryDBD::Pg::db do failed: ERROR: invalid input syntax for type boolean: +"" at /usr/share/perlproj/cgi-bin/editprod.pl line 44
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to implement a checkbox that will send data to db
by terrykhatri (Acolyte) on Jul 10, 2014 at 10:56 UTC |