本文整理汇总了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;
}
示例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];
}
示例3: getNewsTypes
public static function getNewsTypes()
{
$sql = "select * from newsTypes";
$conn = new DbConn();
$result = $conn->executeQuery($sql);
$conn->freeResult();
$conn->close();
return $result;
}
示例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);
});
示例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;
}