updateUser (function)

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

Purpose

Updates a single piece of user data

Location

users/helpers/users.php

Version Information

First Introduced v2.5.0

Parameters

# Parameter Data Type Required Description
1 $column string Yes The column you wish to update
2 $id int Yes The id of the user whose data you wish to update
3 $value string, int Yes The data you wish to put into that column

Returns

Data Type Description of Returned Data
other Returns the result from the database query

Example

updateUser('email',1,'bob@aol.com')

Further Documentation:

WARNING: This is a legacy function not suited for direct user input on the $column variable as it is unbound. There is really no reason to use this function, but if you do, please make sure that you have whitelisted the column name you will be updating. Updates a single column of a single user on the users table. Returns the full database response including errors