Hi,
I want a form to add a new record to a database if the user doesn't have a record yet. Else I want to update existing record. With help of Bob I got the update to work. But now I can't figure out how to distinguish between saving a new user (via insert) and updating an existing user...?
Greetings.
I want a form to add a new record to a database if the user doesn't have a record yet. Else I want to update existing record. With help of Bob I got the update to work. But now I can't figure out how to distinguish between saving a new user (via insert) and updating an existing user...?
Greetings.
Hi jpurlings,
If the form data includes the value of an existing Primary key value from the table e.g. $form->data['cf_id'] = 999 then the record will be updated, if there is no value set, or it doesn't match an existing record a new one is created.
Note: if the primary key column is named id then there can be problems if the page URL also included an article id!
Bob
If the form data includes the value of an existing Primary key value from the table e.g. $form->data['cf_id'] = 999 then the record will be updated, if there is no value set, or it doesn't match an existing record a new one is created.
Note: if the primary key column is named id then there can be problems if the page URL also included an article id!
Bob
Bob,
Thank you. I think that I did that, but I must be doing something wrong. Credentials of the site are still the same as I sent you, could you please have a look at it?
Thank you.
Thank you. I think that I did that, but I must be doing something wrong. Credentials of the site are still the same as I sent you, could you please have a look at it?
Thank you.
Hi jpurlings,
I still can't access the site - I get this
This site can’t be reached
www.bizzaccelerator.biz took too long to respond.
Search Google for biz accelerator administrator
ERR_CONNECTION_TIMED_OUT
Looks like it is going to a BIT BV IP address and then nothing.
Bob
I still can't access the site - I get this
This site can’t be reached
www.bizzaccelerator.biz took too long to respond.
Search Google for biz accelerator administrator
ERR_CONNECTION_TIMED_OUT
Looks like it is going to a BIT BV IP address and then nothing.
Bob
Bob,
That strange. I tried the site on several pc's and laptops, it works everywhere. The error warning could also be caused by your pc, as this site suggests: http://www.incrediblelab.com/connection-timed-out-error-fixed/.
Hopefully you can enter the site to see what I am doing wrong.
Greetings.
That strange. I tried the site on several pc's and laptops, it works everywhere. The error warning could also be caused by your pc, as this site suggests: http://www.incrediblelab.com/connection-timed-out-error-fixed/.
Hopefully you can enter the site to see what I am doing wrong.
Greetings.
Hi jpurlings,
Right now I can see the site - but it's close to midnight - I'll check again in the morning.
Bob
Right now I can see the site - but it's close to midnight - I'll check again in the morning.
Bob
Hi jpurlings,
I think that is working now. There were various fixes needed - some of them may be from previous debugging attempts.
The main one was that you had a list of fields in the DB Read action that didn't include the cf_id primary key column. So that data wasn't being loaded and wasn't available on save.
There was also some code in the Designer tab that could have been used to get the cf_id value after a DB Save - but that didn't work after a DB Read.
Once the cf_id value is being correctly set in the hidden input the custom code in the DB Save conditions box is no longer needed.
I have also removed the Model ID settings from the DB Read and the DB Save as they are not used in the input element named and so the data would not save correctly.
Bob
I think that is working now. There were various fixes needed - some of them may be from previous debugging attempts.
The main one was that you had a list of fields in the DB Read action that didn't include the cf_id primary key column. So that data wasn't being loaded and wasn't available on save.
There was also some code in the Designer tab that could have been used to get the cf_id value after a DB Save - but that didn't work after a DB Read.
Once the cf_id value is being correctly set in the hidden input the custom code in the DB Save conditions box is no longer needed.
I have also removed the Model ID settings from the DB Read and the DB Save as they are not used in the input element named and so the data would not save correctly.
Bob
This topic is locked and no more replies can be posted.
