write to database

Retrieve the auto-increment key after a database insert in ChronoForms.

Overview

The issue occurs because the standard method to access the newly generated key returns a null value.
Enable form debug mode to locate the correct data path in the 'vars' section, then use the dot notation key path in your PHP code to retrieve the value.

Answered
ChronoForms v7
St StefaNovak 16 Dec, 2023
after filling out the form, I write to a simple database table that has the autoincrement key AID.
How in php after submitting the database I get this key of the just written sentence

$this->get("save_data_107.aid") returns null to me
Max_admin Max_admin 19 Dec, 2023
Answer
enable the form debug, you can then find the path to the key in the "vars" section.
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
St StefaNovak 20 Dec, 2023
I can see it, but I don't know how to get to it in php or html. Please give an example
Max_admin Max_admin 25 Jan, 2024
under the debug you will find a section called "vars", the section has multiple key > value pairs, use the keys path to get the value you need, separate keys by a dot
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.