From 83fabdf5a740571ff6318b8f4b0f47935e72754e Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 8 Jun 2015 17:23:29 +0100 Subject: [PATCH] db.php for mysql --- lib/php/db.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/php/db.php b/lib/php/db.php index 37db523a..1311a5da 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -253,10 +253,18 @@ class table { foreach ($rows as $row) { - $this->fields[$row['name']]['type'] = $row['type']; - $this->fields[$row['name']]['null'] = $row['notnull'] == '0' ? 1 : 0; $this->fields[$row['name']]['extra'] = null; + $this->fields[$row['name']]['type'] = $row['type']; + + if (array_key_exists('notnull',$row)) { + $this->fields[$row['name']]['null'] = $row['notnull'] == '0' ? 1 : 0; + + } else { + $this->fields[$row['name']]['null'] = preg_match('/^1|yes|t/i',$row['null']) ? 1 : 0; + + } + } } -- 2.47.3