fetchUserDetails (function)

Last updated: Fri, Jan 13, 2023 7:38 am
Return to Knowledgebase

Purpose

Legacy function to retrieves info on a single user

Location

users/helpers/users.php

Version Information

First Introduced v2.5.0

See Also:

fetchAllUsers (function)
fetchUserName (function)

Parameters

# Parameter Data Type Required Description
1 $column = null string No Limit your search to one particular column in the users table. Only required if you specify a term.
2 $term = null string No The search term you are looking for in the specified column.
3 $id = null int No Specify an id if you do not wish to specify a column and term.

Returns

Data Type Description of Returned Data
object Returns one row of the users table or false if no match is found.

Example

fetchUserDetails(null,null,1)

Further Documentation:

WARNING: Do not pass user-supplied data to the column parameter of this function as it is unbound and could be vulnerable to SQL injections. It is (and should) really only be used for internal purposes.

Returns the data of a single user.
To get a single user's data by id call
$data = fetchUserDetails(null,null,1);

To get a single user's data by username call
$data = fetchUserDetails('username','admin');

To get a single user's data by email call
$data = fetchUserDetails('email','bob@aol.com');