I'm trying to create a form to update information in a table.
I followed instructions from this - http://greyhead.net/how-to-docs/chronoforms-saving-to-a-database-table. I was able to update the information fine.
The challenge is that the form also adds information to the table. I turn off the DB Connection and it doesn't add or update.
Any ideas?
I followed instructions from this - http://greyhead.net/how-to-docs/chronoforms-saving-to-a-database-table. I was able to update the information fine.
The challenge is that the form also adds information to the table. I turn off the DB Connection and it doesn't add or update.
Any ideas?
Hi snims,
To update an existing record the input returned from the form must include the primary key value of the existing record. If ChronoForms created the table this will be a value of cf_id.
Are you saying that you get a record updated *and* a new record added?
Bob
To update an existing record the input returned from the form must include the primary key value of the existing record. If ChronoForms created the table this will be a value of cf_id.
Are you saying that you get a record updated *and* a new record added?
Bob
Yes - I am able to update the appropriate record AND a new record gets added.
Trying to figure out how to prevent the new record from being added.
Thanks!
Steve
Trying to figure out how to prevent the new record from being added.
Thanks!
Steve
Hi snims,
This is a known bug with ChronoConnectivity working with ChronoForms (in some circumstances) but I'm not sure why it would happen in ChronoForms alone.
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
This is a known bug with ChronoConnectivity working with ChronoForms (in some circumstances) but I'm not sure why it would happen in ChronoForms alone.
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
I've attached the form.
Right now, just trying to get the concept down so have added to the users table.
When I hit submit it adds a new user and updates my name appropriately.
Thanks in advance for the help!
Steve
Right now, just trying to get the concept down so have added to the users table.
When I hit submit it adds a new user and updates my name appropriately.
Thanks in advance for the help!
Steve
Hi snims,
You have (a) the DB Connection set to Yes and (b) code to save the data to the same table in the OnSubmit After box. The form is doing exactly what you've requested and saving the record twice.
As an aside, you should generally not write directly to the jos_users table (or other core Joomla! tables), you run the risk of damaging your site unless you know exactly what you are doing.
If you need to update the User info then use the methods that go with the Joomla! User object; they are more secure than direct updates.
Bob
You have (a) the DB Connection set to Yes and (b) code to save the data to the same table in the OnSubmit After box. The form is doing exactly what you've requested and saving the record twice.
As an aside, you should generally not write directly to the jos_users table (or other core Joomla! tables), you run the risk of damaging your site unless you know exactly what you are doing.
If you need to update the User info then use the methods that go with the Joomla! User object; they are more secure than direct updates.
Bob
When I turn off the db connection it doesn't update the database either. Any ideas why?
Thanks for the comments about the users db. Long term won't be putting info there.
Thanks for the comments about the users db. Long term won't be putting info there.
This topic is locked and no more replies can be posted.