Forums

Updating user data in Joomla with custom fields

fforge 14 Sep, 2012
Hi,

I need to add some custom fields to a registration form which will collect information such as address when users sign up, and then save this data to the user records in the db.

I'm using other components (Frontend User Access) to collect which pages the user has visited, and then export all the information in a .csv, but i'm struggling to find a way to amend the user details in Joomla with their address etc.

I've created forms with User Registration, and Create/Update actions, but I guess i'll need to edit the database to store the new fields? I've never needed to do anything like that, so could anyone point me in the right direction?

Thanks in advance!
GreyHead 14 Sep, 2012
Hi fforge,

I recommend that you don't edit the jos_users table. It will just cause you problems in the future.

Instead create a second table for the extra data and save that. Provided that you include the user id you can always re-link the two when you need them.

Note: Joomla! 2.5 also has a jos_contact_details table which may do what you need?

Bob
fforge 17 Sep, 2012
Thanks for the response,

I looked into updating to 2.5, but I have too many legacy plugins etc unfortunately!

I think using another table makes sense, Im using frontend user access so I think i'll use the table it uses to store information against the user id. The problem I have is how to store this info to the table using a form. I am currently experimenting with On submit, DB save event, but with no success. Is this the correct method for taking data from a form and entering it into a db table?

Thanks again
This topic is locked and no more replies can be posted.