I am working on a small graphing application. In the process of
graphing I use 3 seperate scripts for getting the job done. The first
is the page that the use sees and selects all the data from. This
selected data gets passed internally using session variables to the
next page. This page takes the passed data, runs it for error
checking and determines where to send it next. I have gotten most of
the desired results through this method with acceptable performance,
but I have run across a problem.
Currently my graphing script is set up to accept only an array
containing one or two variables passed in $_SESSION['dataVariables'].
If somebody where to select three variables for graphing I want them
to be able to see all three graphs on one page as the result. My
solution to this answer was to write a loop:
if(count($dataArray) > 2)
{
$count = count($data);
for($i = 0; $i < $count; $i++)
{
$_SESSION['dataArray'] = array($dataArray[$i]);
echo '<img src="graph.php" alt="graph" /><br />';
}
}
Through testing I know that the value inside of $_SESSION['dataArray']
is changing on each loop iteration, but my graphs aren't being
outputted accordingly. Each graph ends up being graphed using
whatever the last value in the array is and for the life of me I
cannot figure out where the problem is.
Any help would be greatly appreciated.
-z0ink