Code to get fields

Need help with the Administration of your Joomla! 3.x site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Lars SV
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Jan 22, 2017 6:36 pm

Code to get fields

Postby Lars SV » Thu Jan 11, 2018 5:25 pm

Hi

I use a form (rsform) where I need to get some fields, from the table fields (userdefiend fields), from the user that is logged in. I can't figure out to get the correct value according to the login user.

To get the username I use

$user = JFactory::getUser();return $user->get('name');

But do I need to use something like select <fieldname> from <tablename> where userid = userid or ?

I'm not the big programmer so please be patient ;)

Regards Lars

User avatar
lefteriskavadas
Joomla! Intern
Joomla! Intern
Posts: 60
Joined: Fri Feb 05, 2016 6:10 pm
Location: Athens, Greece
Contact:

Re: Code to get fields

Postby lefteriskavadas » Thu Jan 11, 2018 8:48 pm

Hi,

Take a look at the documentation . I am not sure but I guess the code the will work for user fields also.

Lars SV
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Sun Jan 22, 2017 6:36 pm

Re: Code to get fields

Postby Lars SV » Fri Jan 12, 2018 4:44 pm

Hi,

Thanks for answering, I have tried but it don't work. I'm not so good at programming, so I can't figure out why it don't work :)

Regards Lars


Return to “Administration Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 8 guests