Ejemplo n.º 1
0
 /**
  * @param int
  * @return bool|user
  */
 public function findById($id)
 {
     $queryBuilder = new queryBuilder();
     $query = $queryBuilder->select('user')->from('users')->where('id = ', $id)->limit(1)->getQuery();
     $data = $this->connection->execute($query);
     if ($data) {
         $user = new user();
         $user->fromArray($data);
         return $user;
     }
     return false;
 }
Ejemplo n.º 2
0
        }
    }
}
$make = "suzuki";
$model = "kizashi";
$newcolor = "green";
$color = "red";
$id = '12';
$i = '2';
$j = '3';
$ob = new queryBuilder();
//$ob->select("*")->from("cars")->where("make", "=", "$make")->execute();
//------------------------------------------------------------------
//$ob->select("id", "make", "model", "color")
//$ob->select("*")
$ob->select(count($column))->from("customers")->groupBy("age")->havingCount("age", ">=", "2")->execute();
//---------------------------------------------------------------
//$ob->insertTo("cars")
//        ->columns("make", "model", "color")
//        ->values("$make", "$model", "$color")
//        ->execute();
//-----------------------------------------------------------------
//$ob->update("cars")
//        ->set("model", "$model")
//        ->set("make", "$make")
//        ->set("color", "$newcolor")
//        ->where("id", "=", "$id")
//        ->withAnd("color", "=", "$color")
//        ->execute();
//-----------------------------------------------------------------
//$ob->deleteFrom("cars")