Not passing Variable inside Select command

QuestionsNot passing Variable inside Select command
Chalaka asked 8 years ago

i have below code written inside grid

$g->select_command = "SELECT tbl_doner.Don_Id, tbl_doner.Don_Name,tbl_doner.Don_Contact,tbl_doner.Don_Email,tbl_grant.Gra_Type,tbl_grant.Gra_Amount FROM tbl_doner, tbl_grant WHERE
tbl_doner.Don_Id = tbl_grant.Don_Id AND Prj_Code = '$PrjCode'";

$out = $g_->render("list_APDonarInfo");

but echo $out not showing the grid with required records.

Appreciate your help


3 Answers
Abu Ghufran answered 8 years ago

Q) How to load grid based on $_POST data from other page?

The grid is loaded with 2 server calls.

1) load the columns of grid.
2) do an ajax call, to load data of grid.

Now, if you want to pass data from external form, it is available for step1. But not there in 2nd ajax call, as it is not posted.
Solution is to put the POST variable in session and use it from session for step2.


if (!empty($_POST["personid"]))
$_SESSION["personid"] = $_POST["personid"];
$pid = $_SESSION["personid"];

and use `$pid` in your SQL.

Jhon Leguizamo answered 6 years ago

Hi! And how make if the $_SESSION var change the value? Reload the grid dont work.
Thanks you

Abu Ghufran answered 6 years ago

If i understand the issue correctly, you can assign some (prefixed) unqiue var name so that it does not get changed other than this page. If there is some misunderstanding please explain further with generting steps.

Your Answer

14 + 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 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?