當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DBConnector::getInstance方法代碼示例

本文整理匯總了PHP中DBConnector::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBConnector::getInstance方法的具體用法?PHP DBConnector::getInstance怎麽用?PHP DBConnector::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DBConnector的用法示例。


在下文中一共展示了DBConnector::getInstance方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct()
 {
     $this->db = DBConnector::getInstance();
 }
開發者ID:Lyn1391,項目名稱:git_hub_totebags,代碼行數:4,代碼來源:UserManager.php

示例2: session_start

<?php

if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
require 'scripts/init.php';
loadScripts();
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$address = $_POST['address'];
$city = $_POST['city'];
$email = $_POST['email'];
$password = $_POST['password'];
$phonenumber = $_POST['phonenumber'];
$province = $_POST['province'];
$zipcode = $_POST['zipcode'];
$userid = $_SESSION['userid'];
$db = DBConnector::getInstance();
$password = MD5($password);
$sql = "UPDATE USERS\n            SET ADDRESS = '{$address}', City= '{$city}', email = '{$email}',\n            password = '{$password}', phonenumber = '{$phonenumber}', \n            province = '{$province}', zipcode = '{$zipcode}'\n            WHERE userid='{$userid}'";
$rows = $db->affectRows($sql);
$data = array();
if ($rows > 0) {
    $data["msg"] = "Data updated!";
} else {
    $data["msg"] = "Data could not be updated! Try again.";
}
echo json_encode($data, JSON_FORCE_OBJECT);
開發者ID:lucatsv,項目名稱:GreekWebApp,代碼行數:28,代碼來源:update.php

示例3: getInstance

 /**
  * Returns a global instance of DBQuery.
  * 
  * @param string $sIncDir Base include path of current system. This param is used by GlobalSystemUpdate. 
  * 
  * @return DBQuery
  */
 public static function getInstance()
 {
     if (!self::$oDBQuery instanceof DBQuery) {
         self::$oDBQuery = new DBQuery(DBConnector::getInstance());
     }
     return self::$oDBQuery;
 }
開發者ID:PhDasen,項目名稱:php_soap_client_mu,代碼行數:14,代碼來源:DBQuery.class.php

示例4: __construct

 public function __construct()
 {
     $this->db = DBConnector::getInstance();
     $_SESSION['cartId'] = $this->getCartId();
     $this->cartId = $_SESSION['cartId'];
 }
開發者ID:lucatsv,項目名稱:GreekWebApp,代碼行數:6,代碼來源:ShoppingCartManager.php

示例5: getLastId

 public static function getLastId()
 {
     return DBConnector::getInstance()->lastInsertRowID();
 }
開發者ID:M4R1KU,項目名稱:WebLog,代碼行數:4,代碼來源:Model.php


注:本文中的DBConnector::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。