⚠ 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

relation or relation nn or not possible



marco

marco
  • profile picture
  • Member

Posted 09 April 2018 - 13:10 PM

HI everyone,

 

I have 2 databases on my phpmyadmin.

 

openstreetmap with tables countries et cities ; and grocery with tables products and colors.

 

in my products table of grocery database, there is a field index (country_id) with a relation to a field (id) of countries of openstreetmap.

 

GROCERY

    -> PRODUCTS

        -> id, name, country_id

 

OPENSTREETMAP

    -> COUNTRIES

        -> id, country, ...

 

 

How link the fields in phpmyadmin ? intern relationship or foreign key ?

 

How can use it in controller to call ?

 

$crud->set_relation('country_id', 'countries.pays', 'countries.pays'); ?

$crud->set_relation_n_n('grocery', 'openstreetmap', 'country_id', 'country'); ?

 

 

It's possible ?

 

 

Someone can help me ? ;O)

 

 

 


marco

marco
  • profile picture
  • Member

Posted 10 April 2018 - 14:43 PM

ok...

 

I found:

 

database2.table