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


PHP Connect::queryAll方法代码示例

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


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

示例1: getByParent

 public function getByParent($parent, $order = NULL)
 {
     $sql = "SELECT * FROM " . $this->tableName . " WHERE rid = '" . $parent . "'";
     if ($order) {
         $sql .= " ORDER BY " . $order;
     } else {
         $sql .= " ORDER BY date DESC";
     }
     $messages = $this->connect->queryAll($sql);
     return $messages;
 }
开发者ID:bogolubov,项目名称:owncollab_talks-1,代码行数:11,代码来源:messages.php

示例2: filterDeleted

 private function filterDeleted($files, $user)
 {
     $sql = "SELECT * " . " FROM oc_activity " . " WHERE user = '" . $user . "' AND type = 'file_deleted'";
     $deletedfiles = $this->connect->queryAll($sql);
     $diff_keys = array();
     foreach ($files as $f => $file) {
         if (in_array($file['file'], array_column($deletedfiles, 'file'))) {
             $diff_keys[] = $f;
         }
     }
     $filtered = array_diff_key($files, $diff_keys);
     return $filtered;
 }
开发者ID:bogolubov,项目名称:owncollab_talks-1,代码行数:13,代码来源:files.php

示例3: getByAuthorOrSubscriber

 public function getByAuthorOrSubscriber($subscriber = NULL, $parent = NULL)
 {
     $userid = !empty($subscriber) ? $subscriber : $this->user;
     if ($userid) {
         $sql = "SELECT um.id as id, m.id as messageid, m.date, m.title, m.text, m.attachements, m.author, m.subscribers, um.status" . " FROM " . $this->tableName . " um" . " INNER JOIN *PREFIX*collab_messages m ON m.id = um.mid" . " WHERE (m.author = '" . $userid . "' OR m.subscribers LIKE '%" . $userid . "%')";
         if (!($parent == NULL)) {
             $sql .= " AND m.rid = " . $parent;
         }
         $sql .= " GROUP BY m.id" . " ORDER BY m.date DESC";
         $messages = $this->connect->queryAll($sql);
         return $messages;
     } else {
         return false;
     }
 }
开发者ID:bogolubov,项目名称:owncollab_talks-1,代码行数:15,代码来源:usermessages.php

示例4: getCaseInsensitiveId

 /**
  * Get correct userid by given 
  * @param $user string
  * @return array
  */
 public function getCaseInsensitiveId($user)
 {
     $sql = "SELECT uid" . " FROM " . $this->tableName . " WHERE LOWER(uid) = LOWER('" . $user . "')";
     $res = $this->connect->queryAll($sql);
     $row = $res[0];
     return $row['uid'];
 }
开发者ID:bogolubov,项目名称:owncollab_talks-1,代码行数:12,代码来源:users.29.04.2016.php

示例5: getUsersEmails

 public function getUsersEmails($uidsString)
 {
     if (is_string($uidsString)) {
         $sql = "SELECT p.configvalue as email, u.uid, u.displayname as name\n                    FROM oc_preferences p\n                    LEFT JOIN oc_users u ON (u.uid = p.userid)\n                    WHERE p.configkey = 'email' AND p.appid = 'settings' AND p.userid IN ({$uidsString});";
         $result = $this->connect->queryAll($sql);
         return $result;
     }
 }
开发者ID:Werdffelynir,项目名称:owncollab_chart,代码行数:8,代码来源:project.php

示例6: getAllGroups

 /**
  * Get all group names
  * @return array
  */
 public function getAllGroups()
 {
     $sql = "SELECT gid FROM *PREFIX*group_user";
     $res = $this->connect->queryAll($sql);
     foreach ($res as $r => $row) {
         $groups[] = $row['gid'] . '-group';
     }
     return $groups;
 }
开发者ID:bogolubov,项目名称:owncollab_talks-1,代码行数:13,代码来源:users.php

示例7: getUngroupUsers

 /**
  * @param bool $refresh
  * @return mixed|null
  */
 public function getUngroupUsers($refresh = false)
 {
     static $usersData = null;
     if ($usersData === null || $refresh) {
         $sql = "SELECT u.uid, u.displayname, p.configvalue as email\n                    FROM *PREFIX*users u\n                    LEFT OUTER JOIN *PREFIX*group_user gu ON (gu.uid = u.uid)\n                    LEFT JOIN *PREFIX*preferences p ON (p.userid = u.uid AND p.appid = 'settings' AND p.configkey = 'email')\n                    WHERE gu.uid IS NULL";
         $usersData = $this->connect->queryAll($sql);
     }
     return $usersData;
 }
开发者ID:Werdffelynir,项目名称:owncollab_talks,代码行数:13,代码来源:users.php

示例8: getAllIds

 public function getAllIds()
 {
     $users = $this->connect->queryAll("SELECT uid FROM " . $this->tableName);
     return is_array($users) ? $users : [];
 }
开发者ID:raceface2nd,项目名称:owncollab,代码行数:5,代码来源:users.php


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