本文整理汇总了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);
}
示例2: setUp
protected function setUp()
{
$this->connection = ConnectionManager::getConnection();
$this->emptyDatabaseTables();
$this->loadFixtures();
$this->setBrowser('*firefox');
$this->setBrowserUrl('http://localhost/');
}
示例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";
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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);
}
示例11: setUp
protected function setUp()
{
$this->connection = ConnectionManager::getConnection();
$this->emptyDatabaseTables();
$this->startFakemail();
}
示例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);
}
示例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);
}
示例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);
}
示例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!"));