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


PHP mysqli_result函数代码示例

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


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

示例1: getResult

 function getResult($query)
 {
     return mysqli_result($this->conn, $query);
 }
开发者ID:roshanmadhushanka,项目名称:Environment-Monitoring-System,代码行数:4,代码来源:DBase.php

示例2: read_invitations

function read_invitations()
{
    global $TABLE_PREFIX, $admintpl, $language, $CURUSER, $STYLEPATH, $btit_settings;
    $scriptname = htmlspecialchars($_SERVER["PHP_SELF"] . "?page=admin&user=" . $CURUSER["uid"] . "&code=" . $CURUSER["random"] . "&do=invitations");
    $addparam = "";
    $res = get_result("SELECT COUNT(*) as invites FROM {$TABLE_PREFIX}invitations", true);
    $count = $res[0]["invites"];
    list($pagertop, $pagerbottom, $limit) = pager('15', $count, $scriptname . "&");
    $admintpl->set("inv_pagertop", $pagertop);
    $admintpl->set("inv_pagerbottom", $pagerbottom);
    $results = get_result("SELECT * FROM {$TABLE_PREFIX}invitations ORDER BY id DESC {$limit}", true);
    $invitees = array();
    $i = 0;
    foreach ($results as $id => $data) {
        $res = do_sqlquery("SELECT username FROM {$TABLE_PREFIX}users WHERE id = " . $data["inviter"], true);
        if (mysqli_num_rows($res) > 0) {
            $inviter_name = mysqli_result($res, 0, 0);
        } else {
            $inviter_name = 'Unknown';
        }
        $invitees[$i]["inviter"] = "<a href=\"index.php?page=userdetails&amp;user=" . $data["inviter"] . "\">" . $inviter_name . "</a>";
        $invitees[$i]["invitee"] = unesc($data["invitee"]);
        $invitees[$i]["hash"] = unesc($data["hash"]);
        $invitees[$i]["time_invited"] = $data["time_invited"];
        $invitees[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=invitations&amp;action=delete&amp;id=" . $data["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
        $i++;
    }
    $admintpl->set("invitees", $invitees);
    $admintpl->set("language", $language);
}
开发者ID:Karpec,项目名称:gizd,代码行数:30,代码来源:admin.invitations.php

示例3: user_id_from_username

function user_id_from_username($username)
{
    global $db;
    $username = sanitize($username);
    $query2 = mysqli_query($db, "SELECT (`id`) FROM `users` WHERE `username` = '{$username}'");
    return mysqli_result($query2, 0, 'id');
}
开发者ID:AleksandarGjorgievski,项目名称:biblioteka,代码行数:7,代码来源:users.php

示例4: book_exists

function book_exists($bookname)
{
    global $db;
    $bookname = sanitize($bookname);
    $query = mysqli_query($db, "SELECT COUNT(`title`) FROM `books` WHERE `title` = '{$bookname}'");
    return mysqli_result($query, 0) == 1 ? true : false;
}
开发者ID:AleksandarGjorgievski,项目名称:biblioteka,代码行数:7,代码来源:general.php

示例5: product_picture

function product_picture($product_id)
{
    $connect = Database();
    $picture_result = mysqli_result(mysqli_query($connect, "SELECT picture_type FROM product_pictures WHERE product_id='{$product_id}';"));
    $picture_type = $picture_result['picture_type'];
    $picture_url = "../@pages/images/products/" . $product_id . "_1." . $picture_type;
    return $picture_url;
}
开发者ID:ideagital,项目名称:jinuemall.com,代码行数:8,代码来源:function.php

示例6: plogger_stats_count_total_comments

function plogger_stats_count_total_comments()
{
    $query = "SELECT COUNT(*) AS `n` FROM `" . PLOGGER_TABLE_PREFIX . "comments` WHERE approved = 1";
    $result = run_query($query);
    $num_comments = mysqli_result($result, 0, 'n');
    echo $num_comments . ' ';
    echo $num_comments == 1 ? plog_tr('comment') : plog_tr('comments');
}
开发者ID:nadams810,项目名称:ploto,代码行数:8,代码来源:theme_functions.php

示例7: user_count

function user_count()
{
    // pentru a arata cati utilizatori inregistrati avem pe site
    include 'core/db/db_connection.php';
    $sql = "SELECT COUNT(user_id) FROM `_users` WHERE active = 1";
    $data = mysqli_query($dbCon, $sql);
    return mysqli_result($data, 0);
}
开发者ID:vpandichi,项目名称:worldtour_proiect,代码行数:8,代码来源:general.php

示例8: getScoreByStrategy

function getScoreByStrategy($roundId, $strategyId)
{
    $link = getDBConnection();
    if (mysqli_select_db($link, getDBName())) {
        $roundId = intval($roundId);
        $strategyId = intval($strategyId);
        return mysqli_result(mysqli_query($link, "SELECT score FROM scores WHERE round = {$roundId} AND strategy = {$strategyId}"), 0);
    }
}
开发者ID:CSchool,项目名称:AIBattle,代码行数:9,代码来源:procStrategies.php

示例9: login

function login($username, $password)
{
    require 'core/database/connect.php';
    //file that connects to database
    $user_id = user_id_from_username($username);
    $username = sanitize($username);
    //    $password = md5($password); ideally we want to encrypt the password when the user registers
    return mysqli_result(mysqli_query($connect, "SELECT COUNT(`ID`) FROM `users` WHERE `UserName` = '{$username}' AND `Password` = '{$password}'"), 0) == 1 ? $user_id : false;
}
开发者ID:abelhect,项目名称:merkdoenvio,代码行数:9,代码来源:user.php

示例10: tableExists

function tableExists($tablename, $database = false)
{
    global $dbTmp;
    if (!$database) {
        $res = mysqli_query($dbTmp, "SELECT DATABASE()");
        $database = mysqli_result($res, 0);
    }
    $res = mysqli_query($dbTmp, "SELECT COUNT(*) as count\n        FROM information_schema.tables\n        WHERE table_schema = '{$database}'\n        AND table_name = '{$tablename}'");
    return mysqli_result($res, 0) == 1;
}
开发者ID:macwinnie,项目名称:TeamPass,代码行数:10,代码来源:upgrade_ajax.php

示例11: grr_sql_query1

function grr_sql_query1($sql)
{
    $r = mysqli_query($GLOBALS['db_c'], $sql);
    if (!$r) {
        return -1;
    }
    if (mysqli_num_rows($r) != 1 || mysqli_field_count($GLOBALS['db_c']) != 1 || ($result_ = mysqli_result($r, 0, 0)) == "") {
        $result_ = -1;
    }
    mysqli_free_result($r);
    return $result_;
}
开发者ID:Sirlefou1,项目名称:GRR2,代码行数:12,代码来源:mysql.inc.php

示例12: login

function login()
{
    $db_host = 'localhost';
    $db_username = 'root';
    $db_password = '';
    $db_name = 'Attendance';
    $con = mysql_connect($db_host, $db_username, $db_password) or die(mysql_error());
    mysql_select_db($db_name);
    $query = "SELECT * FROM users WHERE email = '" . $_POST['email'] . "' AND password = '" . $_POST['password'] . "'; ";
    mysqli_query($conn, $query);
    if (mysqli_result()) {
        header("Location: Attendace.php");
        /* Redirect browser */
        exit;
    } else {
        $credentials = false;
    }
}
开发者ID:youcaf,项目名称:Laab_11_Web,代码行数:18,代码来源:LoginForm.php

示例13: read_styles

function read_styles()
{
    global $TABLE_PREFIX, $language, $CURUSER, $admintpl, $STYLEPATH;
    $sres = style_list();
    for ($i = 0; $i < count($sres); $i++) {
        $res = do_sqlquery("SELECT COUNT(*) FROM {$TABLE_PREFIX}users WHERE style = " . $sres[$i]["id"], true);
        $sres[$i]["style_users"] = mysqli_result($res, 0, 0);
        $sres[$i]["style"] = unesc($sres[$i]["style"]);
        $sres[$i]["style_url"] = unesc($sres[$i]["style_url"]);
        $sres[$i]["style_type"] = $sres[$i]["style_type"] == 1 ? $language["CLA_STYLE"] : ($sres[$i]["style_type"] == 2 ? $language["ATM_STYLE"] : ($sres[$i]["style_type"] == 3 ? $language["PET_STYLE"] : $language["UNKNOWN"]));
        $sres[$i]["edit"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=style&amp;action=edit&amp;id=" . $sres[$i]["id"] . "\">" . image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]) . "</a>";
        $sres[$i]["delete"] = "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=style&amp;action=delete&amp;id=" . $sres[$i]["id"] . "\" onclick=\"return confirm('" . AddSlashes($language["DELETE_CONFIRM"]) . "')\">" . image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]) . "</a>";
    }
    $admintpl->set("style_add", false, true);
    $admintpl->set("language", $language);
    $admintpl->set("styles", $sres);
    $admintpl->set("style_add_new", "<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=style&amp;action=add\">" . $language["STYLE_ADD"] . "</a>");
    unset($sres);
    mysqli_free_result($res) || is_object($res) && get_class($res) == "mysqli_result" ? true : false;
}
开发者ID:fchypzero,项目名称:cybyd,代码行数:20,代码来源:admin.styles.php

示例14: ishappyHour

function ishappyHour($n)
{
    global $TABLE_PREFIX;
    $happyHour = mysqli_result(mysqli_query($GLOBALS["___mysqli_ston"], "SELECT UNIX_TIMESTAMP(value_s) FROM {$TABLE_PREFIX}avps WHERE arg='happyhour'"), 0);
    $happyDate = date("Y-m-d H:i", $happyHour);
    $curDate = date("Y-m-d H:i");
    $nextDate = date("Y-m-d H:i", $happyHour + 3600);
    if ($n == "check") {
        if ($happyDate < $curDate && $nextDate >= $curDate) {
            return true;
        }
    }
    if ($n == "time") {
        $timeLeft = $happyHour + 3600 - time();
        return NDF($timeLeft);
    }
}
开发者ID:Karpec,项目名称:gizd,代码行数:17,代码来源:functions.php

示例15: unesc

             $modules[$i]["module_activated"] = $language["NO"] . "&nbsp;&nbsp;->&nbsp;&nbsp;<a href=\"index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=module_config&amp;action=change_to_yes&amp;id=" . unesc($row_modules["id"]) . "\">" . $language["ACTIVATE"] . "</a>";
         }
         // yes
         $modules[$i]["module_date_changed"] = unesc($row_modules["changed"]);
         // when last switched on or off
         $modules[$i]["module_date_created"] = unesc($row_modules["created"]);
         // the date created
         $i++;
     }
     $admintpl->set("modules", $modules);
     $active_modules = do_sqlquery("SELECT COUNT(*) FROM {$TABLE_PREFIX}modules WHERE activated='yes'", true);
     $admintpl->set("nr_active_modules", mysqli_result($active_modules, 0, 0));
     $not_active_modules = do_sqlquery("SELECT COUNT(*) FROM {$TABLE_PREFIX}modules WHERE activated='no'", true);
     $admintpl->set("nr_not_active_modules", mysqli_result($not_active_modules, 0, 0));
     $total_modules = do_sqlquery("SELECT COUNT(*) FROM {$TABLE_PREFIX}modules", true);
     $admintpl->set("nr_total_modules", mysqli_result($total_modules, 0, 0));
     $admintpl->set("form_action", "index.php?page=admin&amp;user=" . $CURUSER["uid"] . "&amp;code=" . $CURUSER["random"] . "&amp;do=module_config&amp;action=add");
     break;
     // end of case 'manage'
 // end of case 'manage'
 case 'change_to_yes':
     $id = max(0, $_GET["id"]);
     $admintpl->set("language", $language);
     do_sqlquery("UPDATE {$TABLE_PREFIX}modules SET activated='yes', changed=NOW() WHERE id={$id}", true);
     redirect("index.php?page=admin&user=" . $CURUSER["uid"] . "&code=" . $CURUSER["random"] . "&do=module_config&action=manage");
     die;
     break;
 case 'change_to_no':
     $id = max(0, $_GET["id"]);
     $admintpl->set("language", $language);
     do_sqlquery("UPDATE {$TABLE_PREFIX}modules SET activated='no', changed=NOW() WHERE id={$id}", true);
开发者ID:Karpec,项目名称:gizd,代码行数:31,代码来源:admin.module_config.php


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