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