当前位置: 首页>>代码示例>>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;未经允许,请勿转载。