How to input the data in a field and once the record is created copy this value and insert it in a different table?
I was thinking 'sql set' in the tablename.php file in the insert function, can someone share a functioning script for this scenario?
Create new record -> table1.field1 = test1 -> hit the create button, then if u query table1.field1 = test1 and query M_Table.field1 = test1
The reason behind it is to create a master hidden table which I can filter and make customized searches since appgini does not support the creation of a view, so this master table would have all the values from all other tables. Example:
Table1.field1 = test1
Table1.field2 = test2
Table1.field3 = test3
Table2.field1 = test4
Table2.field2 = test5
M_Table.field1 = test1
M_Table.field2 = test2
M_Table.field3 = test3
M_Table.field4 = test4
M_Table.field5 = test5
Spread same value to two tables *not autofill*
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Spread same value to two tables *not autofill*
Also, if I update values in table1 the values from table2 would also be updated, trying something like this...
Code: Select all
$copy_query = '
UPDATE product_new a
JOIN product b ON a.product_id = b.product_id
AND b.product_id IN (' . implode(',', $ids) . ')
SET a.product_description = b.product_description,
a.image = b.image';
mysql_query($copy_query);
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Spread same value to two tables *not autofill*
*note Table1.field1 and Table.field1 will be an 'id' value
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: Spread same value to two tables *not autofill*
I am willing to pay $20 through paypal for anyone who can guide me through this whole script that has to work like that:
When I create a new record in table1 it checks the current table id to see if the master table (M_table) has a correspondent id, if it does then the data will be updated and if it doesnt exist its gonna create a record in the table1 and M_table at the same time.
When I create a new record in table1 it checks the current table id to see if the master table (M_table) has a correspondent id, if it does then the data will be updated and if it doesnt exist its gonna create a record in the table1 and M_table at the same time.
Re: Spread same value to two tables *not autofill*
Hello D Oliveira ,
you can check the answer of your question in this thread
https://forums.appgini.com/phpbb/viewto ... f=2&t=2620
you can check the answer of your question in this thread
https://forums.appgini.com/phpbb/viewto ... f=2&t=2620