function q($query, $arr = array()) { $q = \Fw\Db::prepare($query); $q->execute($arr); return $q; }
function update() { $this->get_fields(); $arr = array(); $query = "update " . $this->_table . " set "; foreach ($this->_field_list as $v) { $query .= "{$v} = ?,"; $arr[] = $this->{$v}; } $query = substr($query, 0, -1); $query = $query . " where " . $this->_pk . " = " . $this->{$this->_pk}; $p = Db::prepare($query); $p->execute($arr); }
/** * @param $query * @param array $arr * */ function q($query, $arr = array()) { $q = Db::prepare($query); $q->execute($arr); }