Why does this work:
$whichGrid=”fuel_usage.php”;
$myTable=”fuel_usage”;
include(“grids/”.$whichGrid);
But this doesn’t?
$whichGrid=”fuel_usage.php”;
if(isset($_POST[‘section_loc’])){
$myTable=”fuel_usage”;
}
include(“grids/”.$whichGrid);
1 Answers
Hello,
Perhaps, You need to move the include inside the ‘if’ statement.
e.g.
$whichGrid=”fuel_usage.php”;
if(isset($_POST[‘section_loc’])){
$myTable=”fuel_usage”;
include(“grids/”.$whichGrid);
}
Basically, setting table property is necessary for data to show. Currently you are just unsetting the table and all grid code is still in execution.
I don’t know how you are implementing file fuel_usage.php, If above does not solve, you can share that file as well and then I can suggest better.
Your Answer