当前位置: 首页>>代码示例>>PHP>>正文


PHP DataProvider::GetOneRow方法代码示例

本文整理汇总了PHP中DataProvider::GetOneRow方法的典型用法代码示例。如果您正苦于以下问题:PHP DataProvider::GetOneRow方法的具体用法?PHP DataProvider::GetOneRow怎么用?PHP DataProvider::GetOneRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataProvider的用法示例。


在下文中一共展示了DataProvider::GetOneRow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: triggerAudio

<script>
function triggerAudio(abc) {
    var playid = abc.id.substring(4);
    document.getElementById("audio"+playid).play();
}
</script>

<?php 
if (isset($_SESSION['UID']) && isset($_GET['bh'])) {
    $userId = $_SESSION['UID'];
    $bhId = $_GET['bh'];
    // Check history exists
    $lichSuBaiHocModel = DataProvider::GetOneRow("select * from lichsubaihoc where lsbh_TaiKhoan={$userId} AND lsbh_BaiHoc={$bhId}");
    if ($lichSuBaiHocModel) {
        // If exist, update counter
        $result = DataProvider::ExecuteQuery("update lichsubaihoc set lsbh_SoLanHoc=lsbh_SoLanHoc+1 where lsbh_ID={$lichSuBaiHocModel['lsbh_ID']}");
        //var_dump($result);
        //echo 'count';exit;
    } else {
        // If not exist, insert
        $result = DataProvider::ExecuteQuery("insert into lichsubaihoc(`lsbh_TaiKhoan`, `lsbh_BaiHoc`, `lsbh_ThoiGian`, `lsbh_SoLanHoc`) values ({$userId}, {$bhId}, now(), 1)");
        //var_dump($result);
        //echo 'insert';exit;
    }
}
$idBaiHoc = $_GET["bh"];
$idLoaiBaiHoc = $_GET["lbh"];
$result = DataProvider::GetRows("select * from cau where c_BaiHoc = {$idBaiHoc}");
foreach ($result as $value) {
    $chon = rand(1, 5);
    if ($chon == 1) {
开发者ID:hackernam,项目名称:TapDoc-HocSinhLop1,代码行数:31,代码来源:inc-baihoc-cau.php

示例2: xuLyDangNhap

<?php

require_once "process/xuly_dangnhap.php";
include_once "dataconfig/dataprovider.php";
$xx = new xuLyDangNhap();
if (isset($_POST['btnLogin'])) {
    //document.getElementById("result").innerHTML =''; // Variable To Store Error Message
    $xx->HandleError('');
    $id = $xx->CheckLoginInDB($_POST['txtUsername'], $_POST['txtPassword']);
    $sql = "select * from taikhoan where tk_TenDangNhap = '" . $_POST['txtUsername'] . "' and tk_MatKhau = '" . $_POST['txtPassword'] . "'";
    $result = DataProvider::GetOneRow($sql);
    if ($id > 0) {
        if (session_status() == PHP_SESSION_NONE) {
            session_start();
        }
        $_SESSION['UID'] = $id;
        $_SESSION["user_name"] = $_POST['txtUsername'];
        $_SESSION['DaDangNhap'] = 1;
        $_SESSION['LoaiNguoiDung'] = $result['tk_LoaiNguoiDung'];
        $xx->RedirectToURL("index.php");
    }
}
?>
  
<a id="thongbaoloi" class="show-top-notification-2 timer-notification" href="#"/>
<div class="top-notification-2 top-notification bg-red-dark timeout-notification">
    <h4>Thông báo</h4>
    <p>
        <?php 
echo $xx->GetErrorMessage();
?>
开发者ID:hackernam,项目名称:TapDoc-HocSinhLop1,代码行数:31,代码来源:inc-dangnhap.php

示例3:

    $TypeBaiHoc = $_REQUEST["cbTypeBaiHoc"];
    if ($name == null) {
        $hinhanh = $_REQUEST["txtHinhAnh"];
    } else {
        $hinhanh = 'upload/HinhAnh/' . $name;
    }
    $solandoc = $_REQUEST["txtSoLanDoc"];
    $sql = "UPDATE baihoc SET bh_TenBaiHoc = '{$tenbaihoc}', bh_ngaytao = '{$tempngaytao}', bh_HinhDaiDien = '{$hinhanh}', bh_LoaiBaiHoc = '{$TypeBaiHoc}', bh_SoLanChon = '{$solandoc}' WHERE bh_ID= '{$id}' ";
    DataProvider::ExecuteQuery($sql);
    echo '<script>alert("Cập nhật thành công!")</script>';
}
?>

<a class="btn btn-primary" href="quanlybaihoc.php">Quay lại</a>
<?php 
$result = DataProvider::GetOneRow("select * from baihoc where bh_ID = {$id}");
?>
<form class="form-horizontal" role="form" action="" method="post" enctype="multipart/form-data">
  <fieldset>
  <legend>Detail User</legend>
  <div class="form-group">
    <label class="col-sm-2 control-label">Tên bài học</label>
    <div class="col-sm-10">
      <input name="txtTenBaiHoc" type="text" class="form-control" required="required" value="<?php 
echo $result[1];
?>
">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">Loại bài học</label>
开发者ID:hackernam,项目名称:TapDoc-HocSinhLop1,代码行数:31,代码来源:inc-editbaihoc.php

示例4:

    $hoten = $_REQUEST["txtFullName"];
    $Password = $_REQUEST["txtPassword"];
    if ($_REQUEST["Gender"] == "1") {
        $Gender = "1";
    } else {
        $Gender = "2";
    }
    $TypeUser = $_REQUEST["cbTypeUser"];
    $sql = "UPDATE taikhoan SET tk_MatKhau = '{$Password}', tk_HoTen = '{$hoten}', tk_GioiTinh = '{$Gender}', tk_LoaiNguoiDung = '{$TypeUser}' WHERE tk_ID= '{$id}' ";
    DataProvider::ExecuteQuery($sql);
    echo '<script>alert("Cập nhật thành công!")</script>';
}
?>
<a class="btn btn-primary" href="quanlytaikhoan.php">Back</a>
<?php 
$result = DataProvider::GetOneRow("select * from taikhoan where tk_ID = {$id}");
?>
<form class="form-horizontal" role="form" action="" method="post" enctype="multipart/form-data">
  <fieldset>
  <legend>Detail User</legend>
  <div class="form-group">
    <label class="col-sm-2 control-label">Họ Tên</label>
    <div class="col-sm-10">
      <input name="txtFullName" type="text" class="form-control" required="required" value="<?php 
echo $result[1];
?>
">
    </div>
  </div>
  <div class="form-group">
    <label class="col-sm-2 control-label">Tên Tài Khoản</label>
开发者ID:hackernam,项目名称:TapDoc-HocSinhLop1,代码行数:31,代码来源:inc-edittaikhoan.php


注:本文中的DataProvider::GetOneRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。