Hi,
How to create autoincrement by using 2 table that have relation. I'm using 2 tables.
The selected column in the picture is needed autoincrement.
Thanks
How to create autoincrement by using 2 table that have relation. I'm using 2 tables.
The selected column in the picture is needed autoincrement.
Thanks
Hi Yudhizth,
I'm sorry, I don't understand your question :-(
Auto increment is managed by MySQL when a new record is created.
If you want to link two tables then you need to set the column names to the same value for both DB Save actions.
Bob
I'm sorry, I don't understand your question :-(
Auto increment is managed by MySQL when a new record is created.
If you want to link two tables then you need to set the column names to the same value for both DB Save actions.
Bob
Hi Yudhizth,
I'm sorry, I don't understand your question :-(
Auto increment is managed by MySQL when a new record is created.
If you want to link two tables then you need to set the column names to the same value for both DB Save actions.
Bob
Make it simple, is chronoform have autoincrement feature (php script, etc) without using autoincrement from MySQL.?
Because I'm not expert with php, I'm Java 🤣
Hi Yudhizth,
There is nothing included in ChronoForms. It is possible but you have to solve two problems:
a) You have to store the last used id somewhere. Either in a database table; or it can be stored in a plain text file.
b) You have to make sure that the id is unique - there is a possible problem if two users submit the form at the same time and both get the same id. That's not likely but it is possible. The best solution to this one is to link your id to a database table id and let MySQL manage the uniqueness.
Bob
There is nothing included in ChronoForms. It is possible but you have to solve two problems:
a) You have to store the last used id somewhere. Either in a database table; or it can be stored in a plain text file.
b) You have to make sure that the id is unique - there is a possible problem if two users submit the form at the same time and both get the same id. That's not likely but it is possible. The best solution to this one is to link your id to a database table id and let MySQL manage the uniqueness.
Bob
Hello,
I was reviewing this forum and I need to have a field which auto increments its value. Can you please show the steps in order to link a field to a database table id in order to have a autoincrement field in my form?
Thanks in advance,
David
I was reviewing this forum and I need to have a field which auto increments its value. Can you please show the steps in order to link a field to a database table id in order to have a autoincrement field in my form?
Thanks in advance,
David
Hi David,
After a DB Save action ChronoForms adds the new record ID to the $form->data[''] array so you can use that in later actions. Does that do what you need?
Bob
After a DB Save action ChronoForms adds the new record ID to the $form->data[''] array so you can use that in later actions. Does that do what you need?
Bob
Hi Bob,
Thanks for your help. I worked just fine!!
Kind regards,
David
Thanks for your help. I worked just fine!!
Kind regards,
David
This topic is locked and no more replies can be posted.