]> git.nbdom.net Git - nb.git/commitdiff
Merge branch 'master' of git.nbdom.net:nb
authorNicolas Boisselier <nicolas.boisselier@semantico.com>
Tue, 16 Aug 2016 15:30:02 +0000 (16:30 +0100)
committerNicolas Boisselier <nicolas.boisselier@semantico.com>
Tue, 16 Aug 2016 15:30:02 +0000 (16:30 +0100)
1  2 
lib/php/db.php

diff --cc lib/php/db.php
index 16143b9b4815c0a14ef2101d56c81bf1d8bb4806,7fc989ea5f4e4ed61cb8278e671d21b473d6056c..56c0c0b80d476c09e298879e799227c0859e532b
@@@ -911,14 -861,20 +911,20 @@@ return
        'h' => 'header',
      ));
  
 -    #if($format = out::client_type()) Db::pset('format',$format);
 +    #if($format = out::client_type()) self::pset('format',$format);
  
      # Param - Extract dbname from table
 -    if (preg_match('/^(\w+)\.(.*?)$/',Db::p('table'),$m)) {
 -      Db::pset('db',$m[1]);
 -      Db::pset('table',$m[2]);
 +    if (preg_match('/^(\w+)\.(.*?)$/',self::p('table'),$m)) {
 +      self::pset('db',$m[1]);
 +      self::pset('table',$m[2]);
      }
  
+     # Select param
+     if (Db::p('table') and Db::p('select')) {
+       Db::pset('table','SELECT '.(Db::p('select')).' FROM '.Db::p('table'));
+       Db::pset('select','');
+     }
    }
  
  } # < Class