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


PHP SQL::fetchAssoc方法代码示例

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


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

示例1: getList

 public function getList()
 {
     $result = SQL::query("SELECT * FROM users;");
     $response = array();
     for ($i = 0; $i < $result->num_rows; $i++) {
         $line = SQL::fetchAssoc($result);
         array_push($response, $line);
     }
     return $response;
 }
开发者ID:asjs-dev,项目名称:lab.coop,代码行数:10,代码来源:User.class.php

示例2: getList

 public function getList()
 {
     $userId = $_SESSION["userId"];
     $result = SQL::query("SELECT * FROM foods WHERE user_id = " . $userId . ";");
     $response = array();
     for ($i = 0; $i < $result->num_rows; $i++) {
         $line = SQL::fetchAssoc($result);
         array_push($response, $line);
     }
     return $response;
 }
开发者ID:asjs-dev,项目名称:lab.coop,代码行数:11,代码来源:Food.class.php

示例3: getList

 public function getList()
 {
     $food = new Food();
     $userId = $_SESSION["userId"];
     $result = SQL::query("SELECT * FROM calories WHERE user_id = " . $userId . ";");
     $response = array();
     for ($i = 0; $i < $result->num_rows; $i++) {
         $line = SQL::fetchAssoc($result);
         $foodData = $food->getById($line["food_id"]);
         $line["food_data"] = $foodData;
         array_push($response, $line);
     }
     return $response;
 }
开发者ID:asjs-dev,项目名称:lab.coop,代码行数:14,代码来源:Calories.class.php

示例4: substr

}
// unique identifer for this session, to validate ajax requests.
// document root is included because it is likely a difficult value
// for potential attackers to guess
$requestKey = substr(md5(session_id() . $_SERVER["DOCUMENT_ROOT"]), 0, 16);
if (isset($conn) && $conn->isConnected()) {
    if (isset($_GET['db'])) {
        $db = $conn->escapeString($_GET['db']);
    }
    if (isset($_GET['table'])) {
        $table = $conn->escapeString($_GET['table']);
    }
    if ($conn->hasCharsetSupport()) {
        $charsetSql = $conn->listCharset();
        if ($conn->isResultSet($charsetSql)) {
            while ($charsetRow = $conn->fetchAssoc($charsetSql)) {
                $charsetList[] = $charsetRow['Charset'];
            }
        }
        $collationSql = $conn->listCollation();
        if ($conn->isResultSet($collationSql)) {
            while ($collationRow = $conn->fetchAssoc($collationSql)) {
                $collationList[$collationRow['Collation']] = $collationRow['Charset'];
            }
        }
    }
}
// undo magic quotes, if necessary
if (get_magic_quotes_gpc()) {
    $_GET = stripslashesFromArray($_GET);
    $_POST = stripslashesFromArray($_POST);
开发者ID:okite11,项目名称:frames21,代码行数:31,代码来源:functions.php

示例5: get

 public function get()
 {
     $result = SQL::query("SELECT daily_calories FROM users WHERE id = '" . $_SESSION["userId"] . "' LIMIT 1;");
     return SQL::fetchAssoc($result);
 }
开发者ID:asjs-dev,项目名称:lab.coop,代码行数:5,代码来源:Settings.class.php


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