How to insert in 2 tables at the same time
- Single Page
Posted 02 April 2012 - 21:05 PM
I have 3 tables:
language_id:[list]
[*]id
[*]code
[*]description
[/list]
article: [list]
[*]id
[*]parent_id
[/list]
article_translation:[list]
[*]id
[*]article_id
[*]language_id
[*]description
[/list]
I want to insert an article and his translation.
how to pass the language id to add form,
and how to insert data in article then in article_translation?
thanks,
Posted 03 April 2012 - 22:21 PM
/topic/53-insert-operations-on-model-with-set-relation-where/
I use function: "change_field_type"
$crud->change_field_type('language_id', 'hidden', $lang);
Posted 16 May 2012 - 12:06 PM
category table:
id_cat
ordr
level
second table category_info:
id
id_cat
name
desc
relation is 1-n on id_cat
Posted 08 June 2012 - 14:14 PM
Posted 09 June 2012 - 16:15 PM
/topic/527-multilanguage-solution-crud/page__p__2059#entry2059
Posted 10 October 2013 - 09:47 AM
Hey @web-johnny, wanted to know the progress on the integration of set_relation_1_1 for the new release.
I'm currently using the latest release of Grocery CRUD (version 1.4.1).
So, I'm working on a project that includes Sales Module, the user enters sales details and after the sales have been saved it has to automatically calculate if there was profit or loss. If profit enters details to Profits Table (has field 'profit_made'), if loss was incurred during the sale, then the record has to be entered to the Loss Table (has field 'loss_incurred').
How should I implement this in my project?