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


PHP DbConn::close方法代碼示例

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


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

示例1: addReviews

 public static function addReviews($articleId, $userName, $body, $face)
 {
     $sql = "insert into reviews(articleId,userName,body,face)values({$articleId},'{$userName}','{$body}','{$face}')";
     $conn = new DbConn();
     $row = $conn->executeUpdate($sql);
     $conn->close();
     return $row;
 }
開發者ID:xiaowanzi1204,項目名稱:news,代碼行數:8,代碼來源:Reviews.php

示例2: checkLogin

 public static function checkLogin($userName, $password)
 {
     $sql = "select * from manager where userName='{$userName}' and password='{$password}'";
     $conn = new DbConn();
     $result = $conn->executeQuery($sql);
     $conn->close();
     return $result[0];
 }
開發者ID:xiaowanzi1204,項目名稱:news,代碼行數:8,代碼來源:Manager.php

示例3: getNewsTypes

 public static function getNewsTypes()
 {
     $sql = "select * from newsTypes";
     $conn = new DbConn();
     $result = $conn->executeQuery($sql);
     $conn->freeResult();
     $conn->close();
     return $result;
 }
開發者ID:xiaowanzi1204,項目名稱:news,代碼行數:9,代碼來源:NewsTypes.php

示例4: users

        $sql1 = "INSERT INTO users (email, reg_date) VALUES ('" . $input['email'] . "', " . time() . ")";
        $result1 = $DbConn->conn->query($sql1);
        $sql2 = "INSERT INTO profile (user_id, " . $fields . ", last_modified) VALUES (" . mysqli_insert_id($DbConn->conn) . ", " . $values . ", " . time() . ")";
        $result2 = $DbConn->conn->query($sql2);
        if ($result1 && $result2) {
            echo mysqli_insert_id($DbConn->conn);
            $DbConn->conn->commit();
        } else {
            echo "Error occured";
            $DbConn->conn->rollback();
        }
    } catch (Exception $e) {
        $DbConn->conn->rollback();
        echo $e->getMessage();
    }
    $DbConn->close();
});
$app->post('/addAdmin', function () use($app) {
    $input = $app->request()->post();
    $mongo = new MongoClient();
    $db = $mongo->people;
    $a = $db->peoples->insert($input);
    var_dump($a);
});
$app->post('/addAddress', function () use($app) {
    $input = $app->request()->post();
    //    $mongo = new MongoClient ();
    // $db = $mongo->people;
    // $a = $db->peoples->insert($input);
    var_dump($input);
});
開發者ID:amiturfnd,項目名稱:people,代碼行數:31,代碼來源:apiController.php

示例5: getNewsTwo

 public static function getNewsTwo($typeId)
 {
     $sql = "select * from newsArticles where typeId={$typeId} order by dateandtime desc limit 0,2";
     $conn = new DbConn();
     $result = $conn->executeQuery($sql);
     $conn->freeResult();
     $conn->close();
     return $result;
 }
開發者ID:xiaowanzi1204,項目名稱:news,代碼行數:9,代碼來源:NewsArticles.php


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