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


PHP DBQuery::get_row_cnt方法代码示例

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


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

示例1: BadTimeSemanticException

 function __construct($crn, $begin_change, $end_change, $day_change = '')
 {
     // precondition check on begin and end times
     if (intval($begin_change) >= intval($end_change)) {
         throw new BadTimeSemanticException("begin time must be earlier than end time");
     }
     // this is the change description for the section (potentially)
     $this->desc = array($begin_change, $end_change, $day_change);
     // look up the section by CRN; use the selected term code
     $use_term = self::$term_id;
     $opt = self::$term_id != '' ? "AND term_code = {$use_term}" : "";
     $q = new DBQuery("SELECT id, begin_time, end_time, dow FROM banner.section WHERE crn = {$crn} {$opt};");
     if ($q->is_empty()) {
         throw new SectionNotFoundException();
     }
     if ($q->get_row_cnt() > 1) {
         // this should not occur given preconditions of the database
         throw new HandlerException("more than one section found given input CRN");
     }
     // remember important attributes about the section
     $row = $q->get_next_row();
     // the query should have only retrieved one query
     $this->sid = $row[0];
     $this->curdesc = array($row[1], $row[2], $row[3]);
     // if no dow was supplied in the section change description, then use the current dow for the course
     // this is important as it allows a correct REGEX to be generated by 'generate_sql_where_dow_overlap'
     if ($day_change == '') {
         $this->desc[2] = $this->curdesc[2];
     }
 }
开发者ID:starbuck93,项目名称:14F_CS374_Team2,代码行数:30,代码来源:libhandler.php

示例2: exit

  <body>
<center>
<?php 
include_once "{$_SERVER['DOCUMENT_ROOT']}/php-bin/libquery.php";
if (!isset($_GET) || !array_key_exists('noBackLink', $_GET) || $_GET['noBackLink'] == 'false') {
    echo "<a style= \"margin-top:10px;margin-left:10px;\" class=\"pure-button pure-button-primary\" href=\"/index.html\">Banner Main</a></div>";
}
if (!isset($_GET) || !array_key_exists('bannerid', $_GET)) {
    echo "<p><strong>Bad request</strong></p>\n";
} else {
    $bannerid = $_GET['bannerid'];
    if (!is_numeric($bannerid)) {
        echo "<p>{$bannerid} is not a valid Banner ID</p>";
        exit(0);
    }
    $student = new DBQuery("SELECT last_name, first_name FROM banner.student WHERE banner.student.id = {$bannerid};");
    if ($student->get_row_cnt() == 0) {
        echo "<p>No results for Banner ID={$bannerid}</p>";
        exit(0);
    }
    $row = $student->get_next_row();
    echo "<h1>Schedule listing for {$row[0]}, {$row[1]} [{$bannerid}]</h1>";
    $schedule = new DBQuery("SELECT crn, subject_code, number, title, begin_time, end_time, dow FROM banner.student_section INNER JOIN\nbanner.section ON banner.section.id = banner.student_section.section_id INNER JOIN banner.course ON\nbanner.section.course_id = banner.course.id INNER JOIN banner.student ON\nbanner.student_section.student_id = banner.student.id\nWHERE banner.student_section.student_id = {$bannerid}\nORDER BY course.title;");
    echo $schedule->htmlitize();
}
?>

 </center> </body>
</html>
开发者ID:starbuck93,项目名称:14F_CS374_Team2,代码行数:29,代码来源:student-schedule.php

示例3: exit

    if ($q->get_row_cnt() == 0) {
        echo "<p> No results found for course {$titles[$i]} {$numbers[$i]} </p>";
        exit(1);
    }
    while (true) {
        $row = $q->get_next_row();
        if ($row === false) {
            break;
        }
        $cids[] = $row[0];
    }
}
$sects = array();
foreach ($cids as $id) {
    $q = new DBQuery("SELECT id FROM banner.section WHERE banner.section.course_id = {$id};");
    if ($q->get_row_cnt() == 0) {
        echo "<p> No sections found for course with id={$id} </p>";
        exit(1);
    }
    while (true) {
        $row = $q->get_next_row();
        if ($row === false) {
            break;
        }
        $sects[] = $row[0];
    }
}
$results = array();
foreach ($sects as $id) {
    $q = new DBQuery("SELECT student_id FROM banner.student_section WHERE banner.student_section.section_id = {$id};");
    while (true) {
开发者ID:starbuck93,项目名称:14F_CS374_Team2,代码行数:31,代码来源:student-search.php


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