• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_all函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: get_lang

<?php

$active = "labor";
$lang = get_lang();
if (isset($_POST['submit'])) {
    $labor_name = $_POST['laborname'];
    $labor = array('labor_name' => $labor_name);
    save('labor', $labor);
}
if (isset($_GET['del'])) {
    delete('labor', 'labor_id', $_GET['del']);
    delete('labor_content', 'labor_id', $_GET['del']);
}
$labor = get_all('labor');
require 'view/labor/add_labor_name.php';
开发者ID:hoangvantuan,项目名称:adtourist,代码行数:15,代码来源:add_labor_name.php


示例17: intval

//title website ================================================================
$title = CONTACT_TITLE_INDEX;
//paging =======================================================================
if (isset($_GET['page'])) {
    $page = intval($_GET['page']);
} else {
    $page = 1;
}
$page = $page > 0 ? $page : 1;
$limit = 10;
$offset = ($page - 1) * $limit;
$options = array('limit' => $limit, 'offset' => $offset, 'order_by' => 'id ASC');
//data of paging ===============================================================
//Search data ==================================================================
$url = 'admin.php?controller=contact';
if (isset($_POST['search'])) {
    header('location:admin.php?controller=contact&search=' . $_POST['search']);
}
if (isset($_GET['search'])) {
    $search = escape($_GET['search']);
    $options['where'] = "LOWER(contact.NAME) LIKE LOWER('%{$search}%') ";
    $url = 'admin.php?controller=contact&search=' . $_GET['search'];
}
$total_rows = get_total('contact', $options);
$total = ceil($total_rows / $limit);
$pagination = pagination($url, $page, $total);
//data show ====================================================================
$status = array(0 => CONTACT_STATUS_WAIT, 1 => CONTACT_STATUS_RESPONE);
$contacts = get_all('contact', $options);
//load view ====================================================================
require 'backend/views/contact/index.php';
开发者ID:ngogiangthanh,项目名称:avalon-web,代码行数:31,代码来源:index.php


示例18: call

<?php 
if (!empty($_GET['id'])) {
    $_GET['id'] = (int) $_GET['id'];
    if (empty($_POST['wood'])) {
        $_POST['wood'] = 0;
    } else {
        $_POST['wood'] = (int) $_POST['wood'];
    }
    if (empty($_POST['iron'])) {
        $_POST['iron'] = 0;
    } else {
        $_POST['iron'] = (int) $_POST['iron'];
    }
    if (empty($_POST['stone'])) {
        $_POST['stone'] = 0;
    } else {
        $_POST['stone'] = (int) $_POST['stone'];
    }
    call($q = "update towns set t_wood = t_wood +" . $_POST['wood'] . " , t_stone = t_stone + " . $_POST['stone'] . ", t_iron = t_iron + " . $_POST['iron'] . " where t_id = " . $_GET['id']);
}
$towns = get_all("select * from towns");
if (is_array($towns)) {
    echo "<table>\n\t";
    foreach ($towns as $town) {
        echo "\n\t\t<tr style='border-bottom: solid 1px black'>\n\t\t\t<td style='border-bottom: solid 1px black'>\n\t\t\t\t{$town->t_name}<br/>\n\t\t\t\tdrewno: " . $town->t_wood . " glina: " . $town->t_stone . " żelazo: " . $town->t_iron . "\n\t\t\t</td>\n\t\t\t<td style='border-bottom: solid 1px black'>\n\t\t\t\t<form action='?action=add_res&id=" . $town->t_id . "' method='post'>\n\t\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>drewno</td>\n\t\t\t\t\t\t<td>glina</td>\n\t\t\t\t\t\t<td>żelazo</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><input type='text' name='wood' value='0'/></td>\n\t\t\t\t\t\t<td><input type='text' name='stone' value='0'/></td>\n\t\t\t\t\t\t<td><input type='text' name='iron' value='0'/></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t<input type='submit' value='dodaj surowce'/>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t</tr>";
    }
} else {
    echo "brak miast";
}
?>
</table>
开发者ID:WlasnaGra,项目名称:Utopia,代码行数:31,代码来源:add_res.php


示例19: reload

<?php

if (!empty($_GET['spell_cast'])) {
    $HeroMgr->spell_cast($config, $player, $_GET['spell_cast']);
    reload($config, 'spells', '');
}
if (!empty($_GET['spell_dispel'])) {
    $HeroMgr->spell_dispel($config, $player, $_GET['spell_dispel']);
    reload($config, 'spells', '');
}
$spells = get_all($q = "select *, e_end - unix_timestamp() as eend from arena_spells_param inner join arena_user_spells on usp_usr_id = " . $player->usr_id . " and spp_id = usp_spp_id left join arena_events on e_usr_id = " . $player->usr_id . " and e_type = 1 and e_subtype = spp_id and e_done = 0");
$echo = '';
if (is_array($spells)) {
    $echo = "znane czary<hr/>";
    foreach ($spells as $spell) {
        $options = '';
        if ($spell->usp_active == 0 && $spell->spp_energy <= $player->energy) {
            $options .= "<a href='?action=spells&spell_cast=" . $spell->spp_id . "' >[ rzuć zaklęcie ]</a>";
        } elseif ($spell->usp_active == 1) {
            $options .= "Czar trwać będzie: " . date("H:i:s", $spell->eend - 3600) . " <a href='?action=spells&spell_dispel=" . $spell->spp_id . "' >[ rozprosz zaklęcie ]</a>";
        }
        $spell->spp_text .= "<br/>";
        if ($spell->spp_attack > 0) {
            $spell->spp_text .= "Rzucone zaklęcie będzie zwiększać <span class='red'>atak</span> herosa o <span class='red'>" . 1 * $spell->spp_attack . "</span><br/>";
        }
        if ($spell->spp_defence > 0) {
            $spell->spp_text .= "Rzucone zaklęcie będzie zwiększać <span class='red'>obronę</span> herosa o <span class='red'>" . 1 * $spell->spp_defence . "</span><br/>";
        }
        if ($spell->spp_absorb > 0) {
            $spell->spp_text .= "Rzucone zaklęcie będzie zwiększać <span class='red'>absorbcję</span> herosa o <span class='red'>" . 1 * $spell->spp_absorb . "</span><br/>";
        }
开发者ID:WlasnaGra,项目名称:Arena,代码行数:31,代码来源:spells.php


示例20: get_lang

<?php

$active = "visa";
$lang = get_lang();
$visa_name = get_all('passport_visa');
if (isset($_POST['submit'])) {
    if ($_FILES['fileToUpload']['name'] != null) {
        $target_dir = ".././asset/image/visa/" . $lang . '/';
        $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
        $uploadOk = 1;
        $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION);
        $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
        if ($check !== false) {
            $ok = "File is an image - " . $check["mime"] . ".";
            $uploadOk = 1;
        } else {
            $error = "File is not an image.";
            $uploadOk = 0;
        }
        // Check if file already exists
        if (file_exists($target_file)) {
            $error = "Sorry, file already exists.";
            $uploadOk = 0;
        }
        // Check file size
        if ($_FILES["fileToUpload"]["size"] > 5000000) {
            $error = "Sorry, your file is too large.";
            $uploadOk = 0;
        }
        // Allow certain file formats
        if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif") {
开发者ID:hoangvantuan,项目名称:adtourist,代码行数:31,代码来源:add_visapost.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_all_category_ids函数代码示例发布时间:2022-05-15
下一篇:
PHP get_alias_list函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap