]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 26 May 2018 12:04:04 +0000 (13:04 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 26 May 2018 12:04:04 +0000 (13:04 +0100)
lib/php/db/table.php
www/dbq/dbq.php

index 4c803488fba7c1e4e288db735e8e5de4533b7fa1..49e7f9982c4c2ce036d3aa2aeb235f7b9ee0782c 100644 (file)
@@ -522,7 +522,7 @@ Class Table extends nb {
                return html_edit($values,$form_action,true);
        }
 
-       private function _html_edit_sql($values = null,&$add=false) {
+       public function html_edit_sql($values = null,&$add=false) {
                $where = $this->where($this->fields(),$values);
                if (empty($where)) {
                        $where = ' WHERE 1=0';
@@ -548,7 +548,7 @@ Class Table extends nb {
                if (!$add) {
                        if (!$fct) {
                                $fct = function (&$table,&$values) use ($add) {
-                                       $sql = $table->_html_edit_sql($values,$add);
+                                       $sql = $table->html_edit_sql($values,$add);
                                        $st = $table->db()->conn->prepare($sql);
                                        $st->execute();
                                        $row = $st->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT);
index 0b4002afddb02230187dc54fe50d80ad1e5730e0..10b34b34bd0f5eb0e0b50a78b8aba81d41840eb7 100644 (file)
@@ -454,7 +454,8 @@ class DbQ extends nb {
                # Handle format for /vi 
                if ($this->params['format'] != $this->format_html) {
 
-                       $row = $this->db->query2h($this->table->sql_edit($values));
+                       #debug($values);
+                       $row = $this->db->query2h($this->table->html_edit_sql($values));
                        if ($fields) {
                                foreach ($row as $k=>$v) {
                                        if (!in_array($k,$fields)) unset($row[$k]);