⚠ 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



Alberto Ferrer

Alberto Ferrer
  • profile picture
  • Member

Posted 30 April 2015 - 19:15 PM

Hello, i'm triying to create a relation from my table users and my table tickets, on my tickets i want to display the user name and last name based on id from users and uid from tickets.

 

 


Lucas

Lucas
  • profile picture
  • Member

Posted 30 April 2015 - 19:19 PM

use this 

$crud->set_relation('user_id','users','{username} - {last_name} {first_name}');

Alberto Ferrer

Alberto Ferrer
  • profile picture
  • Member

Posted 30 April 2015 - 19:28 PM

 

use this 

$crud->set_relation('user_id','users','{username} - {last_name} {first_name}');

 

I did 

$crud->set_relation('uid','users','{first_name} {last_name}');

And worked, thank you.

 

Now let me ask another question, this will list the tickets and the replies are stored on another table, so i must add a button to read the replies and answer them? 


Lucas

Lucas
  • profile picture
  • Member

Posted 30 April 2015 - 19:37 PM

http://www.grocerycrud.com/documentation/options_functions/callback_column