edit previously entered infomation into DB

th thewelt 04 Jul, 2018
Hi there,I created a form to let registred joomla users on my website save personal information into a DB-tabel. That went pretty good. I works fine.But now I want to use the same form to let the user edit there own information (of course after they are logged in).How can I
    let the user see its information already filled in into the form?
    make sure the user is editing previously provide information (so he is overwriting earlier content without entering a new record in de DB table)?
I used to do this in CF5 but how does that work in CF 6?
​
Thank you for your help !
Gr GreyHead 05 Jul, 2018
Hi thewelt,
​
You can use a Data read action to check if there is any saved data with the current user ID and load that into the form data.
​
Bob
th thewelt 05 Jul, 2018
OK thank you Bob.
​
That worked but when "the user" tries to update it's data a new entry in the table is made instead of the previous data is updated.
​
When I use the update option in safe data action, every users udates the same entry.
When I use the insert optrion, every time a new line is inserted.
When I use the auto detect option, every time a new line is inserted.
​
What am I doing wrong?
​
cheers,
Bart Weltens
he healyhatman 06 Jul, 2018
You need to add the user id to the where conditions of the update action.
​
So should be something like
​
user_id:{user:id}
​
depending on how you're storing the user id in your table.
This topic is locked and no more replies can be posted.