Hi,

what´s the correct way with DBI to update a field in a mysql database
when the field type is 'bit'?

I´m getting, for example, converted to integer, 53 instead of 3 into
the field.

It goes like this:


my $sth = $dbh->prepare("INSERT INTO t (`status`) VALUES (?)
                         ON DUPLICATE KEY UPDATE `status` = ?");

$sth->execute(($var eq 'x' ? 1 : 0), ($var eq 'x' ? 3 : 0));


That should work just fine but doesn´t in that the wrong bits of the
field are being set.

Is this a bug or a feature?

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to