# NB 05.04.16 return $this->db()->exec($sql)->fetchColumn();
}
-# NB 01.04.16 public function out($v,$head=false) { return $this->db()->out($v,$head); }
- public function out2($v,$head=array()) { return $this->db()->out2($v,$head); }
+ public function out($v,$head=array()) { return $this->db()->out($v,$head); }
public function infos() {
return
public function action($action=null) {
if ($action === null) $action = $this->p('action');
+# NB 23.05.16 $aliases = function($search) {
+# NB 23.05.16 foreach ([
+# NB 23.05.16 [ 'table.fields', 'fields' ],
+# NB 23.05.16 ] as $k=>$v) {
+# NB 23.05.16 if ($k === $search or $v === $search) return $k;
+# NB 23.05.16 }
+# NB 23.05.16 };
if ($action == 'table.fields' or $action == 'fields') {
- #return $this->out2(var_export(($this->fields()),true));
- #return $this->out2(serialize(($this->fields())));
- return $this->out2(array_values($this->object2array($this->fields())));
+ return $this->out(array_values($this->object2array($this->fields())));
} elseif ($action == 'table.rows' or $action == 'rows') {
$this->db()->print_header($this->p('format'));
$this->rows(); return true;
} elseif ($action == 'table.info') {
- return $this->out2($this->info());
+ return $this->out($this->info());
} elseif ($action == 'table.delete' or $action == 'delete') {
if (!$this->delete($this->p(),$e)) bye($e);
} elseif ($action == 'table.insert' or $action == 'insert') {
if (!$this->insert($this->p(),$e)) bye($e);
header('Location: '.$this->url_referer());
- $this->out2($e);
+ $this->out($e);
return true;
} elseif ($action == 'table.update' or $action == 'update') {
#$this->bye($this->p());
if (!$this->update($this->p(),$e)) bye($e);
header('Location: '.$this->url_referer());
- $this->out2($e);
+ $this->out($e);
return true;
} elseif (self::class_action_out($this,$action)) {
public function unserialize() {
$o = unserialize($this->serialize());
- #return $this->out2($this->fields('id'));
+ #return $this->out($this->fields('id'));
#return serialize($this->fields());
#$this = $o;
#return($o->sql_name());