本文整理汇总了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;
}
示例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;
}
示例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;
}
}
示例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'];
}
示例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;
}
}
示例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;
}
示例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;
}
示例8: getAllIds
public function getAllIds()
{
$users = $this->connect->queryAll("SELECT uid FROM " . $this->tableName);
return is_array($users) ? $users : [];
}