I did it :-) I Use the Version 4.0 RC1.9. Joomla 1.7.2
I made it with a SQL in the mail and with a status. When I´m writing the key the status is null. Then I take the record with the null status, write the mail and the next step is to change the status, but this can be a problem if two people make it in the same time. But it´s only a risk for a second. But it´s more save when I can take the unique key which chronoforms is writing.
But I have an other stupid problem..with my SQL´s - this one is the first for creating the key. It´s the same db - I make it in the db which saved the form results.
This one ist working
<?php
$con = mysql_connect("localhost",user","pw");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
mysql_query("UPDATE `jos_chronoforms_data_last` SET `key` = CONCAT (SUBSTRING(cf_created,6,2), SUBSTRING(cf_created,9,2), SUBSTRING(cf_uid, 10,6)) WHERE `status` IS NULL");
mysql_close($con);
?>
when I change it like this, it doesn't
<?php
$db =& JFactory::getDBO();
$query =("UPDATE `jos_chronoforms_data_last` SET `key` = CONCAT (SUBSTRING(cf_created,6,2), SUBSTRING(cf_created,9,2), SUBSTRING(cf_uid, 10,6)) WHERE `status` IS NULL");
$db->setQuery($query);
?>