From efeb9c4a97668672f8aaa263e4937461f0b1b725 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Wed, 27 Jan 2021 12:29:59 +0100 Subject: special handling of boolean columns (accept false as value without warning) --- it_dbi.class | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index c9cef54..6e34002 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -956,6 +956,11 @@ function _get_field_info() $this->_convertfunc[$name] = $field['_convertfunc']; $this->_escapefunc[$name] = $field['_escapefunc']; } + else if ($field['Type'] == 'tinyint(1)') + { + $this->_convertfunc[$name] = 'boolval'; + $this->_escapefunc[$name] = 'it_dbi::escape_bool'; + } else if (preg_match('/^(tiny|small|medium|)int|^float|^double$/', $field['Type'])) $this->_convertfunc[$name] = it::match('int', $field['Type']) ? "intval" : "floatval"; } -- cgit v1.2.3