本文整理汇总了PHP中ConnectionManager::closeConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP ConnectionManager::closeConnection方法的具体用法?PHP ConnectionManager::closeConnection怎么用?PHP ConnectionManager::closeConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConnectionManager
的用法示例。
在下文中一共展示了ConnectionManager::closeConnection方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例3: updateSpecificPhoto
function updateSpecificPhoto($project_id, $photo_no, $new_url)
{
$url = self::getSpecificPhotoURL($project_id, $photo_no);
unlink($url);
$ConnectionManager = new ConnectionManager();
$conn = $ConnectionManager->getConnection();
$stmt = $conn->prepare("UPDATE photo SET photo_url=? WHERE project_id=? AND photo_no=?");
$stmt->bind_param("sss", $new_url, $project_id, $photo_no);
$stmt->execute();
$ConnectionManager->closeConnection($stmt, $conn);
}
示例4: 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);
}
示例5: 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);
}
示例6: 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);
}
示例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: updateColorInOptionalCodeTable
function updateColorInOptionalCodeTable($product_id, $new_color, $old_color)
{
$ConnectionManager = new ConnectionManager();
$conn = $ConnectionManager->getConnection();
$stmt = $conn->prepare("UPDATE optional_code SET color = ? WHERE product_id = ? AND color = ?");
$stmt->bind_param("sss", $new_color, $product_id, $old_color);
$stmt->execute();
$ConnectionManager->closeConnection($stmt, $conn);
}
示例9: checkProductPendingOrderStatus
function checkProductPendingOrderStatus($product_id)
{
$result = 0;
$ConnectionMgr = new ConnectionManager();
$conn = $ConnectionMgr->getConnection();
$stmt = $conn->prepare("SELECT COUNT(*) AS count FROM `order` where `product_id` = ? AND `status` = 'pending'");
$stmt->bind_param("s", $product_id);
$stmt->execute();
$stmt->bind_result($count);
while ($stmt->fetch()) {
$result = $count;
}
$ConnectionMgr->closeConnection($stmt, $conn);
return $result;
}
示例10: activateAccount
function activateAccount($customer_id)
{
$verified = "true";
$ConnectionManager = new ConnectionManager();
$conn = $ConnectionManager->getConnection();
$stmt = $conn->prepare("UPDATE customer SET verified=? WHERE customer_id = ?");
$stmt->bind_param("ss", $verified, $customer_id);
$stmt->execute();
$ConnectionManager->closeConnection($stmt, $conn);
}