This repository has been archived on 2026-04-21. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Project_BDE/app/db/queries1.php

13 lines
480 B
PHP

<?php
require_once __DIR__.'/connection.php';
function db_users_paginated(int $limit = 20, int $offset = 0): array {
$sql = "SELECT id, email, username, displayname AS full_name, permissions AS role, created_at
FROM accounts.users ORDER BY created_at DESC LIMIT ? OFFSET ?";
$stmt = db()->prepare($sql);
$stmt->bindValue(1, $limit, PDO::PARAM_INT);
$stmt->bindValue(2, $offset, PDO::PARAM_INT);
$stmt->execute();
return $stmt->fetchAll();
}