How to pass SQL query instead of table to the Grid?

QuestionsHow to pass SQL query instead of table to the Grid?
Tarun Das asked 9 years ago

include("inc/jqgrid_dist.php");
$g = new jqgrid();

// set few params
$grid["caption"] = "Active uses";
$grid["autowidth"] = true;
$g->set_options($grid);

// set database table for CRUD operations
// $g->table = "members";

$out = $g->render("list1");

instead of ($g->table = "clients") I need pass a SQL query
something like ($g->query = "SELECT * FROM members WHERE active='1'";)
How would you do that?

1 Answers
Tarun Das answered 9 years ago

Well, got it. it will be something like
$g->select_command = "SELECT * FROM members WHERE active='1'";

Thank you anyway

Your Answer

2 + 6 =

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 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

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

Let us improve this post!

Tell us how we can improve this post?