⚠ 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

set relation n-n



sobari26

sobari26
  • profile picture
  • Member

Posted 27 June 2012 - 08:12 AM

i HAVE TABLE

1. BIDANGJABATANDIBUKA
- ID_BID
- ID_REKRUTMEN
- QUOTA

2. BIDANGPROGRAMSTUDI
- ID_BIDANG
- ID_REKRUTMEN
- ID_PS

3. PROGRAMSTUDI
- ID_PS
- NAMA_PS

My question is, how insert bidangprogramstudi use relation n-n?

please help me,

Kobus Myburgh

Kobus Myburgh
  • profile picture
  • Member

Posted 17 October 2012 - 15:57 PM

I have similar question elsewhere. I will let you know if I get an answer as well. When you get an answer, please let me know too? Thanks!

Srowako

Srowako
  • profile picture
  • Member

Posted 30 October 2012 - 14:04 PM

Dear sobari26,

Check this,

[img]http://www.grocerycrud.com/assets/uploads/general/relation-n-n.png[/img]
[color=#282828][font=helvetica, arial, sans-serif]BIDANGPROGRAMSTUDI -> [/font][/color][color=#282828][font=helvetica, arial, sans-serif]add field priority INT(11) and[/font][/color][color=#282828][font=helvetica, arial, sans-serif] no primary_id[/font][/color][color=#282828][font=helvetica, arial, sans-serif] [/font][/color][color=#282828][font=helvetica, arial, sans-serif]= film_actor[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]BIDANGJABATANDIBUKA.[/font][/color][color=#282828][font=helvetica, arial, sans-serif]ID_BID = [/font][/color][color=#282828][font=helvetica, arial, sans-serif]BIDANGPROGRAMSTUDI.[/font][/color][color=#282828][font=helvetica, arial, sans-serif]ID_BIDANG <- is relation[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]PROGRAMSTUDI = actor[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]BIDANGJABATANDIBUKA = film[/font][/color]

$crud->set_relation_n_n('jabatan_studies', 'BIDANGPROGRAMSTUDI','PROGRAMSTUDI','ID_BIDANG','ID_REKRUTMEN','NAMA_PS','priority');


Semoga bermanfaat.

victor

victor
  • profile picture
  • Member

Posted 30 October 2012 - 19:53 PM

Srowako, as I understand he wants to use relation "n-n" with the "PROGRAMSTUDI" and another table which have a field "ID_REKRUTMEN" as primary key. But in this case he wants to use "BIDANGJABATANDIBUKA" as main table for the C.R.U.D operations.

Kobus

Kobus
  • profile picture
  • Member

Posted 26 November 2012 - 06:47 AM

Victor has answered the question for me. Best way to do this is to use the add_action. See his post near the bottom here:

[quote name='victor' timestamp='1353786658' post='4427']
I think that to use the "add_action" in this case is the most optimum way.
For example you have one field "position" which you need edit.
But for example other developer may have more fields
which them wants to edit.
And fields may have different types.
I have no idea how to organize it all in one page and that it was convenient.
Sorry, my English is poor.
[/quote]

/topic/963-extra-fields-in-mn-tables/