Hi, I am trying to write some data in the database using the primary key ['cf_id'] as part of it.
So, on confirm i placed this custom code:
The result of it is that I see it on the debugger as
would appreciate some help please.
So, on confirm i placed this custom code:
<?php
$form->data['link'] = "some text {$form->data['area']} {$form->data['cf_id']}";
?>
The result of it is that I see it on the debugger as
[link] => some text 32 59 but I do not see it written in the database under the field [link] !!
would appreciate some help please.
Hi faitas,
Is this the Primary Key of the newly created record? That doesn't exist before the DB Save is made so you'd have to use a second DB Save to update the value afterwards.
Bob
Is this the Primary Key of the newly created record? That doesn't exist before the DB Save is made so you'd have to use a second DB Save to update the value afterwards.
Bob
I do not fully understand you statement. sorry😟
this is a newly created record and when I save it, I want to add the primary key [cf_id] in an other field.
this is a newly created record and when I save it, I want to add the primary key [cf_id] in an other field.
I will give it a second try.... I have placed this piece of code after email verification. so the item has been saved and the cf_id created beforehand.
I am trying to create a link to each form entry and place it in the db table for reference.
In order to do that I need to add the cf_id at the end of a text, like that: http://www.some-page.com/?code={cf_id}
In order to do that I need to add the cf_id at the end of a text, like that: http://www.some-page.com/?code={cf_id}
Hi faitas,
OK.
a. I wouldn't do it that way, the record id is available from a DB Read so I'd build the URL when it is needed. There's a basic principle of database design that says 'don't save the same data twice'.
b. As I said before the cf_id isn't available until after the first DB Save so you would need to use a second DB Save to update the record and add the link.
Bob
OK.
a. I wouldn't do it that way, the record id is available from a DB Read so I'd build the URL when it is needed. There's a basic principle of database design that says 'don't save the same data twice'.
b. As I said before the cf_id isn't available until after the first DB Save so you would need to use a second DB Save to update the record and add the link.
Bob
This topic is locked and no more replies can be posted.
