POST not working for setting initial query

QuestionsPOST not working for setting initial query
Paul Whitfield asked 6 days ago

I am trying to load a grid with a SQL string. You advised using a session variable. However, I cannot get the  load working even using the $_SESSION super global.

I tried using this:

if (!empty($_POST[“ServiceID”]))
{
    $_SESSION[“ServiceID”] = $_POST[“ServiceID”];
}
else
{
    $_SESSION[“ServiceID”] = “0”;
}
$serviceid = $_SESSION[“ServiceID”];

with this:

$grid->set_options($opt);
if ($serviceid == “0”) {
    $grid->select_command = “SELECT ID, instance_date, serviceID FROM serviceinstances”;
}
else {
//    $grid->select_command = “SELECT ID, instance_date, serviceID FROM serviceinstances WHERE ID = “.$serviceid;
    $grid->select_command = $sql;
}
$grid->table = “serviceinstances”;

Any thoughts?

It DOES work with GET and I don’t need to use a session variable so it looks like an issue with POST vs GET…

Your Answer

14 + 9 =

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?