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


PHP DbConn::getDebug方法代碼示例

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


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

示例1: DbConn

<?php

/*
php test file -- connects to xampp db names sousms, user root, pw ""
*/
include "DbConn.class.php";
try {
    // connect to the database -- needed by the classes
    // that implement the behaviors
    $conn = new DbConn("localhost", "sousms", "root", "");
} catch (Exception $e) {
    // add another element
    echo "Exception: " . $conn->getDebug() . "<br />" . "\n";
}
//	echo "No Exception: " . $conn->getDebug() . "<br />". "\n";
$myConn = $conn->getConn();
$dtb = new DateTime(null, new DateTimeZone("America/Los_Angeles"));
$dte = new DateTime(null, new DateTimeZone("America/Los_Angeles"));
$dte->modify("+10 minutes");
echo "\$dte->format() " . $dte->format("Y-m-d H:i:s") . "\n";
$stmt = $myConn->prepare("insert Login values (1, md5('password'), ?, ?)");
$stmt->execute(array($dtb->format("Y-m-d H:i:s"), $dte->format("Y-m-d H:i:s")));
開發者ID:nordquip,項目名稱:sousms,代碼行數:22,代碼來源:callStoredProc.php

示例2: WebServiceMsg

 $msg = new WebServiceMsg();
 $msg->behavior = $req->behavior;
 // assume the worst
 $msg->success = false;
 $msg->statuscode = 1;
 $msg->statusdesc = array();
 $msg->retval = array();
 try {
     // connect to the database -- needed by the classes
     // that implement the behaviors
     $myConn = new DbConn();
 } catch (Exception $e) {
     // add an element to the statusdesc array
     $msg->statusdesc[] = "Validation Failure: " . $e->getMessage();
     // add another element
     $msg->statusdesc[] = $myConn->getDebug();
 }
 switch ($req->behavior) {
     case "getTokenFromCredentials":
         // the constructor for Credentials can do some basic validation
         // (or throw an exception)
         $credentials = new Credentials($req->credentials->username, $req->credentials->password);
         $token = null;
         $expires = null;
         // the validate() method returns true if valid or false
         // token, expires, and msg->statusdesc are all passed
         // by reference and set inside validate()
         if (!$credentials->validate($myConn->getConn(), $token, $expires, $msg->statusdesc)) {
             // captures the reason for failure
             $msg->statuscode = 1;
             // failed
開發者ID:nordquip,項目名稱:sousms,代碼行數:31,代碼來源:ua.php


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