本文整理汇总了PHP中connection::getConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP connection::getConnection方法的具体用法?PHP connection::getConnection怎么用?PHP connection::getConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connection
的用法示例。
在下文中一共展示了connection::getConnection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRowCount
public static function getRowCount()
{
$con = new connection();
$connection = $con->getConnection();
$query = "select * from manufacturer";
$result = $connection->query($query) or die(mysqli_error($connection));
return mysqli_num_rows($result) + 10;
}
示例2: uploadFile
public function uploadFile($uploadclassObj)
{
$fileid = $uploadclassObj->getFileid();
$upload_filename = $uploadclassObj->getFilename();
$con = new connection();
$connection = $con->getConnection();
$query = "insert into uploads values(null, '{$fileid}', '{$upload_filename}')";
$result = $connection->query($query) or die(mysqli_error($connection));
}
示例3: getUserByName
public function getUserByName($name)
{
$con = new connection();
$db = $con->getConnection();
$sql = "SELECT * FROM user WHERE name=" . $name;
foreach ($db->query($sql) as $row) {
$user[] = array('id' => $row['id'], 'name' => $row['name'], 'password' => $row['password'], 'mail' => $row['mail'], 'adresse' => $row['adresse'], 'tel' => $row['tel']);
}
}
示例4: connection
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<?php
require_once "connection.php";
$con = new connection();
$connection = $con->getConnection();
$query = "select * from manufacturer where active=1";
$result = $connection->query($query) or die(mysqli_error($connection));
?>
<div class="container-fluid head" >
<span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
RandomGenerator
</div>
<div class="row">
<br/><br/><br/><br/><br/><br/>
<div class="col-md-2 col-md-offset-3">
<div id="nav">
<div class="active"><a href="index.php">Generate Serials</a></div>
<div><a href="create.php">Create New User</a></div>
<div><a href="editList.php">Add/Delete User</a></div>
</div>
</div>
<div class="col-md-3 main">
示例5: __construct
public function __construct(connection $con)
{
$this->condb = $con->getConnection();
}