asprin
Active member
I'm looking to add a new "int" column to the xf_user table. I tried adding it directly via phpmyadmin but then when I use the following code (in an external application but hosted on the same server), it isn't getting listed in the fetched columns
xf_user table
I'm not entirely sure what the exact approach is since I'm very new to Xenforo and have not much idea about the Administration part.
UPDATE:
After some research, I tried using the Administration section and adding the custom field there also.
But even after doing this, I wasn't able to fetch the column value via the $finder method. Also, the same field isn't visible in the profile section as well. I've not added any add-ons. It's a fresh out-of-the-box template.
PHP:
XF::start($dir);
$app = XF::setupApp('XF\Pub\App');
$session = $app->session();
$uid = $session->get('userId');
if ($uid)
{
$finder = \XF::finder('XF:User');
$user = $finder->where('user_id', $uid)->fetchOne()->toArray();
print_r($user); // this doesn't show the vcash column but shows other out-of-the-box fields
}
xf_user table
I'm not entirely sure what the exact approach is since I'm very new to Xenforo and have not much idea about the Administration part.
UPDATE:
After some research, I tried using the Administration section and adding the custom field there also.
But even after doing this, I wasn't able to fetch the column value via the $finder method. Also, the same field isn't visible in the profile section as well. I've not added any add-ons. It's a fresh out-of-the-box template.