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


PHP get_all函数代码示例

本文整理汇总了PHP中get_all函数的典型用法代码示例。如果您正苦于以下问题:PHP get_all函数的具体用法?PHP get_all怎么用?PHP get_all使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: view

 function view()
 {
     // TODO: Protect against SQL injections some day
     $course_id = $this->params[0];
     $this->course = get_first("SELECT * FROM course WHERE course_id = '{$course_id}'");
     $this->lessons = get_all("SELECT * FROM lesson WHERE course_id = '{$course_id}'");
 }
开发者ID:henno,项目名称:varamu,代码行数:7,代码来源:courses.php

示例2: testAddDeleteDVD

 public function testAddDeleteDVD()
 {
     $many_all = get_all("dvd");
     $this->assertTrue(sizeof($many_all) > 0, "should be at least one dvd in the db");
     $it = get_dvd_by_title($this->the_title);
     $this->assertEqual($it['title'], $this->the_title);
 }
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:7,代码来源:DBTest.php

示例3: is_visible_for

 public function is_visible_for(\System\User $user)
 {
     $is_visible = false;
     if ($this->visibility == \Impro\Status\Visibility::ID_PUBLIC) {
         $is_visible = true;
     } else {
         if ($this->visibility == \Impro\Status\Visibility::ID_TEAMS) {
             foreach (self::$attrs_team as $attr) {
                 if ($this->{$attr}) {
                     $member = get_all('Impro\\Team\\Member')->where(array("user" => $user->id, "team" => $this->team_home->id))->fetch_first();
                     if ($member) {
                         $is_visible = true;
                         break;
                     }
                 }
             }
         } else {
             if ($this->visibility == \Impro\Status\Visibility::ID_COMMUNITY) {
                 $groups = $user->groups->where(array('id' => self::$groups_community))->count();
                 if ($groups) {
                     $is_visible = true;
                 }
             } else {
                 $is_visible = $this->author->id == $user->id;
             }
         }
     }
     return $is_visible;
 }
开发者ID:just-paja,项目名称:improvanywhere-api,代码行数:29,代码来源:model.php

示例4: view

 function view()
 {
     $post_id = $this->params[0];
     $this->post = get_first("SELECT * FROM post NATURAL JOIN user WHERE post_id='{$post_id}'");
     $this->tags = get_all("SELECT * FROM post_tags NATURAL JOIN tag WHERE post_id='{$post_id}'");
     $this->comments = get_all("SELECT * FROM comment WHERE post_id ='{$post_id}'");
 }
开发者ID:ramonp233,项目名称:blog,代码行数:7,代码来源:posts.php

示例5: edit

 function edit()
 {
     $broneering_id = $this->params[0];
     $this->broneering = get_first("SELECT * FROM broneering WHERE broneering_id = '{$broneering_id}'");
     $this->dates = get_all("SELECT * FROM kuupaev");
     $this->times = get_all("SELECT * FROM kellaeg");
 }
开发者ID:DataKeyt,项目名称:meliss,代码行数:7,代码来源:broneering.php

示例6: getUsers

 public function getUsers(array $params)
 {
     $sql = "SELECT * FROM users WHERE deleted=0";
     if (isset($params['order']) && isset($params['field'])) {
         $sql .= " ORDER BY {$params['field']} {$params['order']}";
     }
     return get_all($sql);
 }
开发者ID:kristjanAnd,项目名称:sample,代码行数:8,代码来源:UserService.php

示例7: spells_end

 public function spells_end($config, $player)
 {
     $events = get_all("select * from arena_events where e_type = 1 and e_usr_id = " . $player->usr_id . " and e_done = 0 and e_end <= unix_timestamp()");
     if (is_array($events)) {
         foreach ($events as $event) {
             $this->spell_dispel($config, $player, $event->e_subtype);
         }
         reload($config, 'spells', '');
     }
 }
开发者ID:WlasnaGra,项目名称:Arena,代码行数:10,代码来源:HeroMgr.php

示例8: print_form

function print_form($db, $smarty, $print_ad = 0)
{
    if ($print_ad) {
        $print_ad = get_ad($db, $print_ad);
    }
    $add = get_all($db);
    $smarty->assign('add', $add);
    $smarty->assign('print_ad', $print_ad);
    $smarty->assign('city', get_city($db));
    $smarty->assign('category', get_category($db));
    $smarty->display('form.tpl');
}
开发者ID:aic513,项目名称:Web-programming,代码行数:12,代码来源:functions.php

示例9: town_main

 public function town_main($config, $player)
 {
     $town = (int) $town;
     $events = get_all("select * from events where e_t_id = " . $player->actual_town . " and e_done = 0 and e_end <= unix_timestamp()");
     require_once 'functions/EventsMgr.php';
     $eventMgr = new EventsMgr();
     if (is_array($events)) {
         foreach ($events as $event) {
             $this->build_end($event->e_t_id, $event->e_type, $event->e_subtype, $event->e_count, $event->e_start, $event->e_end);
             $eventMgr->event_end($config, $event->e_id, $event->e_t_id);
         }
     }
 }
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:13,代码来源:MainMgr.php

示例10: categories_delete

/**
 * Xóa bản ghi có khóa chính là $id
 */
function categories_delete($id)
{
    $id = intval($id);
    //xóa sản phẩm
    require_once 'backend/models/products.php';
    $options = array('select' => 'id', 'where' => 'category_id=' . $id);
    $products = get_all('products', $options);
    foreach ($products as $product) {
        products_delete($product['id']);
    }
    //xóa danh mục
    $sql = "DELETE FROM categories WHERE id={$id}";
    mysql_query($sql) or die(mysql_error());
}
开发者ID:sangtdpd00871,项目名称:sangtdpd00871,代码行数:17,代码来源:categories.php

示例11: print_form

function print_form($db, $smarty, $print_ad = 0)
{
    // функция вывода формы
    $add_query = get_ad($db, $print_ad);
    $row = mysqli_fetch_assoc($add_query);
    $smarty->assign('print_ad', $row);
    $add = array();
    $add_query = get_all($db);
    while ($row = mysqli_fetch_assoc($add_query)) {
        $add[$row['id']] = $row;
    }
    $smarty->assign('add', $add);
    $smarty->assign('cities', get_cities($db));
    $smarty->assign('category', get_category($db));
    $smarty->display('dz9-form.tpl');
}
开发者ID:aic513,项目名称:Web-programming,代码行数:16,代码来源:dz9-functions.php

示例12: public_menu

function public_menu()
{
    //funkcija koja sluzi za generisanje menija koji ce se prikazivati javnim korisnicima
    $result = get_all('categories');
    $output = '<ul class="nav navbar-nav">';
    while ($category = mysqli_fetch_assoc($result)) {
        $all_news = get_news($category['id']);
        if (mysqli_num_rows($all_news) > 0 && $category['visible'] == 1) {
            //ako je kategorija vidljiva i ima vidljivih vijesti
            $output .= '<li class="dropdown">';
            $output .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' . $category['title'] . '<span class="caret"></span></a>';
            $output .= '<ul class="dropdown-menu">';
            while ($news = mysqli_fetch_assoc($all_news)) {
                $output .= '<li><a href="index.php?id=' . $news['id'] . '">' . $news['title'] . '</a></li>';
            }
            $output .= '</ul>';
            $output .= '</li>';
        }
    }
    $output .= '</ul>';
    return $output;
}
开发者ID:Ognj3n,项目名称:cms,代码行数:22,代码来源:functions.php

示例13: foreach

                foreach ($dvds as $dvd) {
                    echo "<tr>\n";
                    echo "<td><a href='view_dvd.php?part_title={$dvd[0]}'>{$dvd[0]}</a></td>";
                    for ($i = 1; $i < sizeof($dvd); $i++) {
                        echo "<td>{$dvd[$i]}</td>";
                    }
                    echo "</tr>\n";
                }
                echo "</table><hr />\n";
            }
        } else {
            echo "<h2>No matches were found for {$genre_found}</h2><br /><hr />";
        }
    } catch (DbException $dbe) {
        echo "<h3 class='error'>An error ocurred while feching the dvds for {$genre_found}: {$dbe->getMessage()}</h3>";
    }
}
try {
    $genres = get_all("genre");
    echo "<h2>Genres in the catalogue</h2>";
    if (sizeof($genres) > 0) {
        echo "<ul>\n";
        foreach ($genres as $genre) {
            echo "<li><a href='genres?genre={$genre[0]}'>{$genre[0]}</a></li>\n";
        }
        echo "</ul>\n";
    }
} catch (DbException $dbe) {
    echo "<h3 class='error'>An error ocurred while feching the list of genres: {$dbe->getMessage()}</h3>";
}
include "../dvd-lib-common/foot.html";
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:31,代码来源:genres.php

示例14: index

 function index()
 {
     $this->users = get_all("SELECT * FROM user");
 }
开发者ID:Aphyxia,项目名称:halo,代码行数:4,代码来源:welcome.php

示例15: session_start

<?php

session_start();
require_once "config.php";
$smarty = new Smarty();
$smarty->compile_check = true;
require_once "dvd-db.php";
require_once "dvd-util.php";
try {
    $all_dvds = get_all("dvd");
    $dvd_list = array();
    foreach ($all_dvds as $dvd) {
        array_push($dvd_list, $dvd['title']);
    }
    $smarty->assign("dvd_list", $dvd_list);
    $smarty->assign("heading", "All DVDs in the Library");
} catch (DbException $dbe) {
    display_error_page($smarty, "An error ocurred while feching the list of DVDs: {$dbe->getMessage()}");
}
$smarty->display("list_dvds.tpl");
开发者ID:ahiliation,项目名称:beautifulwork,代码行数:20,代码来源:list_all.php


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