Hello, sorry for banal question
I would like to aucomatic insert concat value in a field acting on "before insert section" on hook.
At the same time I need that this field is read only for users...
SOME_TEXT + ['field1_value'] + SOME_OTHER_TEXT
I have tried many ways like:
$data['field'] = "TEXT" & $data['field1_value'] & "TEXT2" ;
but nothing.
Could you please help me?
Concat text + field + text in hook
Re: Concat text + field + text in hook
You need to make the field as Readonly in Appgini.
and use sql udpate to set the value in your database, something like this:
and use sql udpate to set the value in your database, something like this:
Code: Select all
sql("update `YOURTABLE` set `YOURFEILD` = 'THE VALUE YOU WANT' where `ID` = {$data['ID']}", $eo);
AppGini 22.14 - xampp 3.3.0 - PHP 7.4.30 - Summary reports - Calendar - Mass update - Messages - AppGiniHelper
Re: Concat text + field + text in hook
Thanks.
So you say there is no way to insert value on a field as "concat" between text and value from another field, by using expression like:
$data[field] = concat expression
The only way is by sql.
So you say there is no way to insert value on a field as "concat" between text and value from another field, by using expression like:
$data[field] = concat expression
The only way is by sql.
Re: Concat text + field + text in hook
SOLVED
Easy as drink a glass of water:
$data['field'] = 'TEXT' . $data['field1_value'] . 'TEXT2';
Simply using . (dot)
Easy as drink a glass of water:
$data['field'] = 'TEXT' . $data['field1_value'] . 'TEXT2';
Simply using . (dot)