⚠ 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 forum is read-only and soon will be archived. ⚠

set relation between table to a view

relation view table

  • Please log in to reply
2 replies to this topic

#1 Milfriosc



  • Members
  • Pip
  • 3 posts

Posted 10 November 2016 - 03:49 PM



I already see that it's possible to set primary key to make crud for a view but I want to make crud from a table and use set relation with a view.

$crud->set_relation('fk_streetcode','my_view','streetname',null,'streetname ASC');

with this definition there's an data base error

 ... JOIN "my_view" as "j447c7032" ON "j447c7032". = "my_table"."fk_streetcode" ...

you can see that the primary key for the view is not define  : there is a point without id_street >> "j447c7032". =


sorry for my english ....


Thank's for your answers

#2 Athar



  • Members
  • PipPip
  • 13 posts

Posted 13 January 2017 - 03:14 PM

seems like your (relating) fields are NOT "identical" in both tables.

#3 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts

Posted 18 January 2017 - 02:24 AM

Hi Milfriosc

Can you dhare the table structure for both so some1 can look @it and suggest you the proper stuff?

Also tagged with one or more of these keywords: relation, view, table

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users