Master detail grid

QuestionsMaster detail grid
Mauro asked 6 years ago

Please help me 🙂
I've a table:
– ID
– S_N

– ID
– S_N

For default i've read that is passed the (PK) rowid, how i can pass the S_N?
so i can make a select like this
select * from table2 where table2.s_n = table1.s_n


1 Answers
Abu Ghufran answered 6 years ago

In master grid, you can set extra subgrid params in this way.

$opt["subgridparams"] = "s_n";

And in detail grid, you can use that param in sql command.

$sn = intval($_GET["s_n"]);
$grid->select_command = "select * from table2 where table2.s_n = $sn";

Refer demos/master-detail/master-detail.php.

Your Answer

11 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!