]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/field.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 23 Aug 2016 09:03:25 +0000 (11:03 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 23 Aug 2016 09:03:25 +0000 (11:03 +0200)
lib/php/db/field.php

index 8baf459fcc50a69f3442a62f4732419a53a5eac3..2997dae4ce03a77e46217d6650c8e89b2b517a15 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+require_once(realpath(dirname(__FILE__).'/../nb.php'));
 /*
 $DB_FIELD_TYPES = array(
  'bool' => PDO::PARAM_BOOL,
@@ -222,7 +223,10 @@ class field extends nb {
   public function out($value,$html_escape=false) {
 
     #if ($value === null) return '';
-    static $sqlite = null; if ($sqlite === null) $sqlite = $this->db()->type == 'sqlite';
+    static $sqlite = null; if ($sqlite === null) {
+      $db = $this->db();
+      $sqlite = $db::$type == 'sqlite';
+    }
 
     # Anoying, sqlite does not format properly !
     if ($sqlite and preg_match('/^float\((?:\d+,)?(\d+)\)/',$this->type,$m)) {