當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。