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


PHP DBQuery::get_next_row方法代码示例

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


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

示例1: 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

示例2: find_conflicts_impl

 protected final function find_conflicts_impl()
 {
     $section_id = $this->desc->get_section_id();
     // grab all the students in the section
     $q = new DBQuery("SELECT id FROM banner.student_section INNER JOIN banner.student ON id = student_id WHERE section_id = {$section_id};");
     $students = array();
     while (($row = $q->get_next_row()) !== false) {
         $students[] = $row[0];
     }
     // grab all simple conflicts for the section change description
     $this->q = new DBQuery("SELECT student.id, student.first_name, student.last_name, section.crn, course.subject_code, course.number, course.title, section.begin_time, section.end_time, section.dow\nFROM banner.student_section\nINNER JOIN banner.section ON banner.student_section.section_id = section.id\nAND banner.student_section.section_id <> {$section_id}\nAND " . $this->desc->generate_sql_where_time_overlap("banner.section.begin_time", "banner.section.end_time") . "\nAND " . $this->desc->generate_sql_where_dow_overlap("banner.section.dow") . "\nINNER JOIN banner.student ON banner.student_section.student_id = student.id\nINNER JOIN banner.course ON banner.course.id = banner.section.course_id\nWHERE banner.student.id = " . implode(" OR banner.student.id = ", $students) . ";");
 }
开发者ID:starbuck93,项目名称:14F_CS374_Team2,代码行数:12,代码来源:libhandler.php

示例3: exit

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('crn', $_GET)) {
    echo "<p><strong>Bad request</strong></p>\n";
    exit(0);
}
$crn = $_GET['crn'];
if (!is_numeric($crn)) {
    echo "<p>{$crn} is not a valid CRN value</p>";
    exit(0);
}
// get the course title information
$q1 = new DBQuery("SELECT subject_code, number, title, begin_time, end_time, dow, first_name, last_name FROM banner.course\nINNER JOIN banner.section ON section.course_id = course.id AND crn={$crn}\nINNER JOIN banner.professor ON professor.id = professor_id;");
if ($q1->is_empty()) {
    echo "<p>No results for CRN={$crn}</p>";
    exit(0);
}
$heading = $q1->get_next_row();
$q2 = new DBQuery("SELECT student.id, first_name, middle_name, last_name, classification FROM banner.section\nINNER JOIN banner.student_section ON crn={$crn} AND section.id = section_id\nINNER JOIN banner.student ON student_id = student.id\nORDER BY student.classification, last_name;");
if ($q2->is_empty()) {
    // section shouldn't be empty
    echo "<p>No students where associated with the specified section</p>";
    exit(0);
}
echo "<h1>Section listing for {$heading[0]} {$heading[1]} {$heading[2]} [CRN={$crn}]</h1>" . "<h2>Start Time: {$heading[3]}<br />End Time: {$heading[4]}<br />Meeting Days: {$heading[5]}<br />Professor: {$heading[6]} {$heading[7]}</h2>" . $q2->htmlitize();
?>

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

示例4: exit

        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) {
        $row = $q->get_next_row();
        if ($row === false) {
            break;
        }
        if (!array_key_exists($row[0], $results)) {
            $results[$row[0]] = 1;
        } else {
            ++$results[$row[0]];
        }
    }
}
foreach (array_keys($results) as $k) {
    if ($results[$k] != count($cids)) {
        unset($results[$k]);
    }
}
开发者ID:starbuck93,项目名称:14F_CS374_Team2,代码行数:31,代码来源:student-search.php


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