How to pass the primary id of a row to collect data from another table?

How to pass the primary id of a row to collect data from another table?

shimul.49shimul.49 Posts: 4Questions: 2Answers: 0

Hello,
In my DataTables Editor based application, I have a table user_permisison, which store two values:
1. user_id <-- primary key of users table
2. premission_id <-- primary key of permissions table

Now I want to create a table that will have four columns: user_id, permisison_id, user_full_name, permisison_title. Here I face two problems:

  1. When loading the tables it searches user_full_name, permisison_title in user_permisison tables, but those fields are not available in the table, so I got the following error message:

DataTables warning: table id=pageAccessTable - An SQL error occurred: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'user_name' in 'field list'

How can I tell the Editor not to search those two fields in the user_permisison table?

  1. How can I pass the user_id and permisison_id to fetch content from the desired table (users / permissions)? I mean Here is my instance:

Field::inst( 'user_full_name' ) ->set( false )

In the above instance, what method will I need to use ( get() or getFormatter() ) and how to pass the user_id/permisison_id to load content from users / permissions

  • Thanks

Answers

  • shimul.49shimul.49 Posts: 4Questions: 2Answers: 0

    Got the answer, but don't know how to delete a questions

This discussion has been closed.