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


PHP ConnectionManager::getConnection方法代码示例

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


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

示例1: truncate

 function truncate()
 {
     $ConnectionManager = new ConnectionManager();
     $conn = $ConnectionManager->getConnection();
     $stmt = $conn->prepare("TRUNCATE TABLE free_delivery_price");
     $stmt->execute();
     $ConnectionManager->closeConnection($stmt, $conn);
 }
开发者ID:jackyFeng,项目名称:unisol,代码行数:8,代码来源:FdpManager.php

示例2: setUp

 protected function setUp()
 {
     $this->connection = ConnectionManager::getConnection();
     $this->emptyDatabaseTables();
     $this->loadFixtures();
     $this->setBrowser('*firefox');
     $this->setBrowserUrl('http://localhost/');
 }
开发者ID:p16,项目名称:phpday2010,代码行数:8,代码来源:ListaEventiTest.php

示例3: Listado

 function Listado($valor_debug = 0)
 {
     $this->db = ConnectionManager::getConnection($this->_conexion);
     $this->formato_fecha = "y-m-d";
     $this->debug = $valor_debug;
     $this->db->debug = $this->debug;
     $this->path_image = "imagenes/listado/";
     $this->estilo = "lista";
     $this->javascript["popup"] = " \n\r\n\t\t\t<script language=\"JavaScript\"> \n\r\n\t\t\t\tfunction popup_class_listado(nombre,pagina,x,y){ \n\r\n\t\t\t\t\teval (\"newwin_\" + nombre + \" = window.open('\"+pagina+\"','\"+nombre+\"','height='+y+',top=' + (screen.height-y)/2 + ',width='+x+',left=' + (screen.width - x)/2 + ',toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');\");\n\r\n\t\t\t\t\teval (\"newwin_\" + nombre + \" . focus(); \");\n\r\n\t\t\t\t\treturn false;\n\r\n\t\t\t\t}\n\r\n\t\t\t</script>\n";
 }
开发者ID:Nilphy,项目名称:moteguardian,代码行数:10,代码来源:clase.Listado.php

示例4: getCategory

 public function getCategory()
 {
     $connection = ConnectionManager::getConnection();
     $sql = "SELECT * FROM category";
     $catresult = $connection->query($sql);
     $catArr = array();
     while ($row = $catresult->fetch_assoc()) {
         $catArr[] = $row['name'];
     }
     return $catArr;
 }
开发者ID:melindafekete,项目名称:AuctionSystem_COMPGC06,代码行数:11,代码来源:SearchManager.php

示例5: getAuctionTitle

 public function getAuctionTitle($auctionId)
 {
     //auctionId sanitized
     $auctionId = (int) $auctionId;
     $connection = ConnectionManager::getConnection();
     $sql_bidHistory = "SELECT title\n            FROM auction\n            WHERE id = {$auctionId};\n            ";
     $result_bidHistory = $connection->query($sql_bidHistory);
     while ($row = $result_bidHistory->fetch_assoc()) {
         $auction_title = $row['title'];
     }
     return $auction_title;
 }
开发者ID:melindafekete,项目名称:AuctionSystem_COMPGC06,代码行数:12,代码来源:BidManager.php

示例6: getLosingBuyers

 public function getLosingBuyers($auctionId, $highestBidderId)
 {
     $connection = ConnectionManager::getConnection();
     $auctionId = (int) $auctionId;
     $highestBidderId = (int) $highestBidderId;
     $sql = "SELECT DISTINCT bidder_id FROM bid WHERE auction_id = {$auctionId} AND bidder_id <> {$highestBidderId}";
     $resultSet = $connection->query($sql);
     $losers = array();
     $userManager = new UserManager();
     while ($row = $resultSet->fetch_assoc()) {
         $losers[] = $userManager->getUser($row['bidder_id']);
     }
     return $losers;
 }
开发者ID:melindafekete,项目名称:AuctionSystem_COMPGC06,代码行数:14,代码来源:AuctionAwarderManager.php

示例7: getPostalCode

 function getPostalCode($customer_id, $address_no)
 {
     $ConnectionManager = new ConnectionManager();
     $conn = $ConnectionManager->getConnection();
     $stmt = $conn->prepare("SELECT postal_code FROM address WHERE customer_id=? AND address_no=?");
     $stmt->bind_param("si", $customer_id, $address_no);
     $stmt->execute();
     $stmt->bind_result($postal_code);
     $postalcode = '';
     while ($stmt->fetch()) {
         $postalcode = $postal_code;
     }
     $ConnectionManager->closeConnection($stmt, $conn);
     return $postalcode;
 }
开发者ID:jackyFeng,项目名称:unisol,代码行数:15,代码来源:AddressManager.php

示例8: AbstractEntity

 /**
  * Contructor
  * @access public
  * @param $id (int) Identificador del registro que se va a cargar. Por defecto es vac�o.
  * @return void
  */
 function AbstractEntity($id = "")
 {
     // Obtener una conexi�n a la base
     $this->_db = ConnectionManager::getConnection($this->_connection);
     // Verificar parametro
     if (!empty($id)) {
         $this->id = $id;
     }
     // Inicializar variables (vacio)
     foreach ($this->_fields as $key => $value) {
         eval('$this->$key = \'\';');
     }
     // Cargar
     if (!empty($id)) {
         $this->load($id);
     }
 }
开发者ID:Nilphy,项目名称:moteguardian,代码行数:23,代码来源:AbstractEntity.php

示例9: getUnusedCreditListByReceiverId

 function getUnusedCreditListByReceiverId($receiver_id)
 {
     $creditList = [];
     $ConnectionManager = new ConnectionManager();
     $conn = $ConnectionManager->getConnection();
     $stmt = $conn->prepare("SELECT sender_id, receiver_id FROM credit_history WHERE receiver_id = ? AND status = false");
     $stmt->bind_param("s", $receiver_id);
     $stmt->execute();
     $stmt->bind_result($sender_id, $receiver_id);
     while ($stmt->fetch()) {
         $credit = [];
         $credit["sender_id"] = $sender_id;
         $credit["receiver_id"] = $receiver_id;
         array_push($creditList, $credit);
     }
     $ConnectionManager->closeConnection($stmt, $conn);
     return $creditList;
 }
开发者ID:jackyFeng,项目名称:unisol,代码行数:18,代码来源:CreditManager.php

示例10: setGift

 function setGift($code, $product_name, $worth, $photo)
 {
     $ConnectionManager = new ConnectionManager();
     $conn = $ConnectionManager->getConnection();
     $stmt = $conn->prepare("UPDATE reward SET product_name = ? , worth = ? , photo = ? WHERE code = ?");
     $stmt->bind_param("ssss", $product_name, $worth, $photo, $code);
     $stmt->execute();
     $ConnectionManager->closeConnection($stmt, $conn);
 }
开发者ID:jackyFeng,项目名称:unisol,代码行数:9,代码来源:RewardManager.php

示例11: setUp

 protected function setUp()
 {
     $this->connection = ConnectionManager::getConnection();
     $this->emptyDatabaseTables();
     $this->startFakemail();
 }
开发者ID:p16,项目名称:phpday2010,代码行数:6,代码来源:CreateEventoWBTest.php

示例12: deleteProject

 function deleteProject($project_id)
 {
     $ConnectionManager = new ConnectionManager();
     $conn = $ConnectionManager->getConnection();
     $stmt = $conn->prepare("DELETE FROM project WHERE project_id = ?");
     $stmt->bind_param("s", $project_id);
     $stmt->execute();
     $ConnectionManager->closeConnection($stmt, $conn);
 }
开发者ID:jackyFeng,项目名称:unisol,代码行数:9,代码来源:ProjectManager.php

示例13: reestablishConnection

 public function reestablishConnection($close = true)
 {
     // if connection name property is null the connection manager will use the default connection
     $connection = $this->class->getStaticPropertyValue('connection', null);
     if ($close) {
         ConnectionManager::dropConnection($connection);
         static::clearCache();
     }
     return $this->conn = ConnectionManager::getConnection($connection);
 }
开发者ID:ruri,项目名称:php-activerecord-camelcased,代码行数:10,代码来源:Table.php

示例14: deleteAllPhotosByProduct

 function deleteAllPhotosByProduct($product_id)
 {
     $photoList = self::getPhotos($product_id);
     foreach ($photoList as $url) {
         unlink($url);
     }
     $ConnectionManager = new ConnectionManager();
     $conn = $ConnectionManager->getConnection();
     $stmt = $conn->prepare("DELETE FROM photo WHERE product_id = ?");
     $stmt->bind_param("s", $product_id);
     $stmt->execute();
     $ConnectionManager->closeConnection($stmt, $conn);
 }
开发者ID:jackyFeng,项目名称:unisol,代码行数:13,代码来源:PhotoManager.php

示例15: header

<?php

require_once '../lib/EventoService.php';
require_once '../lib/ConnectionManager.php';
if (!isset($_POST['crea_evento'])) {
    header('Location: http://localhost/phpday2010/web/nuovoevento.php');
}
$evento_s = new EventoService();
$evento_s->creaNuovoEvento($_POST, ConnectionManager::getConnection());
header('Location: http://localhost/phpday2010/web/nuovoevento.php?message=' . urlencode("Evento creato con successo!"));
开发者ID:p16,项目名称:phpday2010,代码行数:10,代码来源:creaevento.php


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