Forums

Saving data problem

chriso0258 10 Apr, 2014
Hello,

I'm having a problem in saving data. I have set up a 3 page process which can be seen below. Initially, a check in person will put in an ID number of a person entering or leaving the facility and press enter (page 1). This takes the check in person to page 2 where they will select from a pair of radio buttons whether a person is entering or leaving the facility. If entering, the status is 0. If leaving the status is 1. If the status is 0, the ckin variable gets set to the current time. If leaving, the ckout variable gets set to the current time.

The users are already in the db. All I want to do is update the value of either ckin or ckout in their record. The problem I'm having is when I use the DB save action, it creates a new record for that user instead of just updating the ckin or ckout value of the user's record.

[attachment=0]CF.jpg[/attachment]

I'm obviously missing something here.

Thanks for your help.
chriso0258 10 Apr, 2014
Sorry, none of these suggestions help. I'm still getting duplicate records made each time i hit submit.
Max_admin 10 Apr, 2014
Hi Chriso,

You must have the value of the record's primary key loaded under a field name matching the primary key field name in order to update the record.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
chriso0258 10 Apr, 2014
Answer
I solved the problem. I didn't bring in the record id (my primary key) when reading the DB. So, I guess without the primary key, even though I had pulled the correct record using the user's personal ID, it didn't recognize that record as the one to save the data to. After I pulled the record id, the data saved to the correct record.
chriso0258 10 Apr, 2014
Thanks for your answer Max. I hadn't refreshed my page when I replied so I didn't see your answer until after I submitted.
This topic is locked and no more replies can be posted.