fetchAllUsers (function)

Last updated: Wed, Jan 4, 2023 3:19 pm
Return to Knowledgebase


Fetches an object of users based on the parameters included



Version Information

First Introduced v2.5.0

See Also:

fetchUserDetails (function)
fetchUserName (function)


# Parameter Data Type Required Description
1 $orderBy = null string No Comma separated params of order by clause to send to the database
2 $desc = false bool No An optional value to order the orderBy in a descending fashion
3 $disabled = true bool No Pass false to remove disabled users from the return


Data Type Description of Returned Data
array of objects Returns data from the users table based on the specific parameters.


$users = fetchAllUsers();

Further Documentation:

$orderBy = \'lname DESC, fname\'; //orders by lname desc, fname
$desc = true; //forces last orderBy param to be desc as well, if no order by is passed, this doesnt do anything
$disabled = false; //removes users who are disabled, DB column permissions
// All the below parameters are optional - remove them all to fetch all users
$users = fetchAllUsers($orderBy, $desc, $disabled);

foreach($users as $u) {