本文整理汇总了PHP中connection::runQuery方法的典型用法代码示例。如果您正苦于以下问题:PHP connection::runQuery方法的具体用法?PHP connection::runQuery怎么用?PHP connection::runQuery使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类connection
的用法示例。
在下文中一共展示了connection::runQuery方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cek_login
function cek_login($user, $pass)
{
$koneksi = new connection();
$user = e_code($user);
$pass = e_code($pass);
$qCek = "SELECT `pemakai`.`id`, `pemakai`.`nama`, `pemakai`.`jk` FROM `pemakai` WHERE `pemakai`.`user` = '{$user}' AND `pemakai`.`kunci` = '{$pass}' AND `pemakai`.`hapus` = '0';";
if ($resCek = $koneksi->runQuery($qCek)) {
if ($resCek->num_rows > 0) {
$rsCek = $resCek->fetch_array();
$_SESSION['en-data'] = e_code($rsCek['id']);
$_SESSION['en-nama'] = $rsCek['nama'];
$_SESSION['en-jk'] = $rsCek['jk'];
$log = $koneksi->runQuery("INSERT INTO `log_login`(`id_user`) VALUES ('" . $rsCek['id'] . "')");
return TRUE;
} else {
return FALSE;
}
} else {
return FALSE;
}
}
示例2: connection
<?php
$data = new connection();
if ($query = $data->runQuery("SELECT COUNT(`id`) FROM `weather_history` WHERE `delete` = '0';")) {
while ($rs = $query->fetch_array()) {
$total = $rs[0];
}
}
?>
<section class="wrapper site-min-height">
<!-- page start-->
<div id="morris">
<div class="row state-overview">
<div class="col-lg-3 col-sm-6">
<section class="panel">
<div class="symbol yellow">
<i class="fa fa-cloud"></i>
</div>
<div class="value">
<h1 class=" count4"><?php
echo 22;
?>
</h1>
<p>Parameter Cuaca</p>
</div>
</section>
</div>
<div class="col-lg-3 col-sm-6">
<section class="panel">
<div class="symbol blue">
<i class="fa fa-bar-chart-o"></i>