Example #1
0
 function q($query, $arr = array())
 {
     $q = \Fw\Db::prepare($query);
     $q->execute($arr);
     return $q;
 }
Example #2
0
 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);
 }
Example #3
0
 /**
  * @param $query
  * @param array $arr
  *
  */
 function q($query, $arr = array())
 {
     $q = Db::prepare($query);
     $q->execute($arr);
 }