From: Nicolas Boisselier Date: Sun, 11 Dec 2016 20:40:09 +0000 (+0000) Subject: sys.port add csync2 X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=dfb6009da83a96be7408cc7ebdb61cd734e2549e;p=nb.git sys.port add csync2 --- diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 7eb5aa75..f5402692 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1379,6 +1379,7 @@ Class Table extends nb { public function insert($hvalues,&$info=[],$insert_word='INSERT') { if (empty($info['values'])) $info['values'] = []; + if (empty($hvalues)) $this->bye('insert(): No values'); $info['values'] = $hvalues; $sql_names = $fields = $values = []; @@ -1391,6 +1392,7 @@ Class Table extends nb { $sql_names[$name] = $field->sql_name(); $values[] = $hvalues[$name]; } + if (empty($fields)) $this->bye('insert(): No fields for table'); $sql = $insert_word.' INTO '. $this->sql_name() . ' (' . join(',',array_values($sql_names)).')' diff --git a/lib/php/nb.php b/lib/php/nb.php index c83c20bb..158127a7 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -290,6 +290,10 @@ class NB { } + if (!empty($_REQUEST)) { + if (empty($_POST)) $_POST = $_REQUEST; + if (empty($_GET)) $_GET = $_REQUEST; + } return $new_argv; }