⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Add multiple rows in two table 1:m relationship?



pseudonymo
  • profile picture
  • Member

Posted 04 December 2012 - 08:43 AM

First and foremost, congratulations to John & everyone here for the excellent addition to CodeIgniter. Πάρa πολύ κaλή δουλειά πaιδιά! :)

For my question: is it possible to use grocery CRUD to set up a 1:m parent-child relationship to add/edit mutiple children for each parent in the following format:

[b]user (parent[/b])
id
name
description
email_address
website

[b]user_address (child[/b])
id
[i]user_id[/i] (fk)
address
city
country

Some posts describe this (e.g., /topic/93-masterdetails-forms-with-grocery-crud), but thought I would ask before spending more time trying to figure this out alone.

Many thanks in advance!

victor
  • profile picture
  • Member

Posted 04 December 2012 - 09:26 AM

Hi Pseudonymo and welcome to the forum.
May be it will be useful to you:
http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n
all documentations is here:
http://www.grocerycrud.com/documentation

pseudonymo
  • profile picture
  • Member

Posted 04 December 2012 - 10:24 AM

victor,

Thanks for your response.

In the page you provided (http://www.grocerycrud.com/documentation/options_functions/set_relation_n_n), relationships are created between the parent entity (film) and existing children entities (actor, category). Is it possible to use grocery CRUD to create both the children entities and the relationship to the parent entity?

Thanks!