当前位置: 首页>>代码示例>>PHP>>正文


PHP bd::prepare方法代码示例

本文整理汇总了PHP中bd::prepare方法的典型用法代码示例。如果您正苦于以下问题:PHP bd::prepare方法的具体用法?PHP bd::prepare怎么用?PHP bd::prepare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bd的用法示例。


在下文中一共展示了bd::prepare方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 public function update($package)
 {
     $con = new bd();
     $sql = "UPDATE package SET id_city=" . $package->getIdCity() . ", name='" . $package->getName() . "', " . "description='" . $package->getDescription() . "', price=" . $package->getPrice() . ", " . "price_promo=" . $package->getPricePromo() . ", date_start='" . $package->getDateStart() . "', date_end='" . $package->getDateEnd() . "', " . "id_user=" . $package->getIdUser() . ", thumbnail='" . $package->getThumbnail() . "' WHERE idpackage=" . $package->getIdPackage();
     $r = $con->prepare($sql);
     $r->execute();
 }
开发者ID:rafael11690,项目名称:topicos2,代码行数:7,代码来源:packageDAO.php

示例2: subir

 public function subir($ar, $ex, $dir)
 {
     $this->dir = $dir;
     $this->archivo = explode(".", $ar['name']);
     $this->extensiones = $ex;
     $random = date("d:m:y:h:i") * rand() * 9999999;
     if (in_array($this->archivo[1], $this->extensiones)) {
         $this->url = $dir . $random . "." . $this->archivo[1];
         if (!file_exists($this->dir)) {
             @mkdir($this->dir, 777);
         }
         $this->arr = array(':nombre' => "hola", ':des' => "Hola", ':url' => $this->url);
         $this->archivo = $ar;
         if (move_uploaded_file($this->archivo['tmp_name'], $this->url)) {
             $base = new bd(TBD, SER, BD, US, CL);
             $i = 1;
             $sql = $base->prepare("INSERT INTO imagen(idimagen, nombre, ruta, foto) VALUES ({$i}+1, {$this->archivo}[1], {$this->url}, {$this->archivo}['tmp_name'])");
             if ($sql->execute($this->arr)) {
                 echo "Imagen subida y almacenada correctamente";
             } else {
                 echo "Error";
             }
         } else {
             echo "error";
         }
     } else {
         echo "Extension invalida";
     }
 }
开发者ID:edigiarch,项目名称:sisregcivil,代码行数:29,代码来源:clase_imagen.php

示例3: insert

 public function insert($city)
 {
     $con = new bd();
     $sql = 'INSERT INTO city (name, state, country, description, thumbnail, id_gallery, id_user) VALUES ' . '("' . $city->getName() . '", "' . $city->getState() . '", ' . '"' . $city->getCountry() . '", "' . $city->getDescription() . '", ' . '"' . $city->getThumbnail() . '", ' . $city->getIdGallery() . ', ' . $city->getIdUser() . ')';
     $r = $con->prepare($sql);
     $r->execute();
 }
开发者ID:rafael11690,项目名称:topicos2,代码行数:7,代码来源:cityDAO.php

示例4: insert

 public function insert($form)
 {
     $con = new bd();
     $sql = "INSERT INTO form_interest (id_package, first_name, last_name, guests_number, couple_room, individual_room, double_room, triple_room, observation, email, area_code, phone, newsletter) VALUES " . "(" . $form->getIdPackage() . ", '" . $form->getFirstName() . "', " . "'" . $form->getLastName() . "', " . $form->getGuestsNumber() . ", " . $form->getCoupleRoom() . ", " . $form->getIndividualRoom() . ", " . $form->getDoubleRoom() . ", " . $form->getTripleRoom() . ", '" . $form->getObservation() . "', '" . $form->getEmail() . "', " . $form->getAreaCode() . ", " . $form->getPhone() . ", " . $form->getNewsletter() . ")";
     $r = $con->prepare($sql);
     $r->execute();
 }
开发者ID:rafael11690,项目名称:topicos2,代码行数:7,代码来源:formDAO.php

示例5: getUser

 public function getUser($login, $password)
 {
     $con = new bd();
     $sql = 'Select * from user where login="' . $login . '" AND password = MD5("' . $password . '")';
     $r = $con->prepare($sql);
     $r->execute();
     $result = $r->fetch();
     $user = new user($result['iduser'], $result['login'], $result['password'], $result['name'], $result['privilege']);
     return $user;
 }
开发者ID:rafael11690,项目名称:topicos2,代码行数:10,代码来源:userDAO.php

示例6: getLastPublishedTime

 public function getLastPublishedTime($uid, $sn)
 {
     $db = new bd();
     $statement = $db->prepare("SELECT * FROM manager_stats WHERE userid=? AND social_network=? ORDER BY time DESC LIMIT 1");
     if ($statement->execute(array($uid, $sn))) {
         $fetch = $statement->fetchAll();
         return $fetch[0]["time"];
     } else {
         return false;
     }
 }
开发者ID:darwinv,项目名称:sambilnew,代码行数:11,代码来源:usuarios.php

示例7: buscarAmigos2

 public function buscarAmigos2($id, $tipo = NULL, $busqueda = NULL)
 {
     $bd = new bd();
     $querynatural = "SELECT ua.usuarios_id numero, seudonimo, CONCAT(nombre,' ', apellido) nombre, estados_id estado\n\t\t\t\t\t\t  FROM usuarios_naturales un, usuarios_accesos ua, usuarios u \n\t\t\t\t\t\t  WHERE u.id = un.usuarios_id AND u.id = ua.usuarios_id ";
     $queryjuridico = "SELECT ua.usuarios_id numero, seudonimo, razon_social nombre, estados_id estado \n\t\t\t\t\t\t  FROM usuarios_juridicos uj, usuarios_accesos ua, usuarios u  \n\t\t\t\t\t\t  WHERE  u.id = uj.usuarios_id AND u.id = ua.usuarios_id ";
     $estado = "";
     $union = "";
     $search = "";
     if (!is_null($tipo)) {
         if ($tipo == "jur") {
             $querynatural = "";
         } elseif ($tipo == "nat") {
             $queryjuridico = "";
         } elseif ($tipo == "all") {
             $union = " UNION ALL ";
         } elseif (is_numeric($tipo)) {
             $estado = " AND estado = {$tipo} ";
             $union = " UNION ALL ";
         }
     } else {
         $union = " UNION ALL ";
     }
     if (!empty($busqueda)) {
         $search = " AND (nombre LIKE '%{$busqueda}%' OR seudonimo LIKE '%{$busqueda}%')";
     }
     $statement = "SELECT numero, seudonimo, nombre, estado \n\t\t\t\t\t  FROM ({$querynatural}\n\t\t\t\t\t\t  {$union}\n\t\t\t\t\t\t  {$queryjuridico}) tabla, usuarios_amigos \n\t\t\t\t\t  WHERE usuarios_id = numero {$estado} {$search}  ";
     die($statement);
     try {
         $sql = $bd->prepare($statement);
         $sql->execute(array($id));
         if ($sql->rowCount() > 0) {
             return $sql->fetchAll();
         } else {
             return false;
         }
     } catch (PDOException $ex) {
         return $bd->showError($ex);
     }
 }
开发者ID:darwinv,项目名称:sambilnew,代码行数:39,代码来源:amigos.php

示例8: getLastPublishedTime

 public function getLastPublishedTime($id, $sn)
 {
     $db = new bd();
     $statement = $db->prepare("SELECT * FROM manager_stats WHERE userid=:uid AND sn=':sn' ORDER BY time DESC LIMIT 1");
     $statement->bindParam(':uid', $uid);
     $statement->bindParam(':sn', $sn);
     $statement->execute();
     $fetch = $statement->fetchAll();
     return $fetch[0]["time"];
 }
开发者ID:darwinv,项目名称:sambilnew,代码行数:10,代码来源:usuarios-old.php


注:本文中的bd::prepare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。