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


PHP DBConnection::ExecuteSelectQuery方法代码示例

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


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

示例1: GetComputersByLab

 /**
  * Gets the computers of the asked lab
  */
 public static function GetComputersByLab($lab_id)
 {
     $sql = "select * from Computers where LabID = " . $lab_id . " order by X1, Y1;";
     $results = DBConnection::ExecuteSelectQuery($sql);
     $computers = self::GetArrayFromDBTable($results);
     return $computers;
 }
开发者ID:davyx8,项目名称:cloud-computing-finap-project,代码行数:10,代码来源:computer.php

示例2: Load

 public static function Load($user_name, $password)
 {
     $user_name = addslashes(stripslashes($user_name));
     $password = md5($password);
     $sql = "select *\n\t\t\t\t\tfrom Users\n\t\t\t\t\twhere\n\t\t\t\t\t\t(UserName = '" . $user_name . "') and\n\t\t\t\t\t\t(Password = '" . $password . "');";
     $results = DBConnection::ExecuteSelectQuery($sql);
     if (count($results) == 0) {
         return null;
     }
     $row = $results[0];
     if ($row["DateActivated"] == null) {
         $date_activated = null;
     } else {
         $date_activated = new DateTime($row["DateActivated"]);
     }
     $user = new User((int) $row["ID"], $row["UserName"], $row["CsUser"], (int) $row["Warnnings"], $row["ActivationKey"], $date_activated, new DateTime($row["DateAdded"]));
     return $user;
 }
开发者ID:davyx8,项目名称:cloud-computing-finap-project,代码行数:18,代码来源:user.php

示例3: GetLabsOccupancy

 public static function GetLabsOccupancy()
 {
     $sql = "select\n\t\t\t\t\tLabs.ID as LabID,\n\t\t\t\t\tLabs.Capacity,\n\t\t\t\t\t(\n\t\t\t\t\t\tselect count(Computers.LabID)\n\t\t\t\t\t\tfrom Computers\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t(Computers.LabID = Labs.ID) and\n\t\t\t\t\t\t\t((Computers.StatusID = 2) or (Computers.StatusID = 3))\n\t\t\t\t\t) as TotalUsed\n\t\t\t\tfrom Labs;";
     $results = DBConnection::ExecuteSelectQuery($sql);
     return $results;
 }
开发者ID:davyx8,项目名称:cloud-computing-finap-project,代码行数:6,代码来源:lab.php

示例4: ini_set

<?php

ini_set("display_errors", 1);
require_once "classes/db_connection.php";
$sql = "select * from Computers;";
$results = null;
try {
    DBConnection::Connect();
    $results = DBConnection::ExecuteSelectQuery($sql);
} catch (Exception $ex) {
}
if ($results != null) {
    foreach ($results as $row) {
        echo $row["ID"] . $row["ComputerName"] . "<br />";
    }
}
DBConnection::Close();
?>
done.
开发者ID:davyx8,项目名称:cloud-computing-finap-project,代码行数:19,代码来源:test.php


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