I’m using a SelectQuery object to retrieve and display a list of users, but I don’t know where to get the user’s picture from.
The users table has a column called picture, but the data in there is just an integer. Is the picture stored in a blob field somewhere or is there a link to the picture in another table?
The image file itself is stored (usually) somewhere in
/sites/default/files. The reference to that image is stored in thefile_managedtable, thepicturecolumn in theuserstable contains thefid(file id) of the picture.You can load the file object like this:
And get the output for the image like this: