Hi Karteek,
I assume that means you are not storing all the data in your database, but only the
latest value. In this case, you must find something to store all your data in your
computer. ChatDirector is not designed as a database and cannot store data. It can only
plot the data that you have stored.
If you are using PHP, PHP will automatically delete all local variables when the script
ends. If you want to store the data for the duration of the user PHP session, you can use
PHP session variables. If you want to store the data for a much longer time (eg. if you
want the data to survive even if the user close off the browser and reopne it the next
day), you would need to store it in the database or somewhere on your hard disk.
An example of using PHP session variables is:
if (!session_id())
session_start();
# Obtain the old data stored in the PHP session variable 'xxx'
if (isset($_SESSION['xxx']))
$data = $_SESSION['xxx'];
else
# If there is no old data, initialize the $data to something you like as the initial data
$data = array(85, 156, 179.5, 211, 123);
...... read data from the database .....
# append the value the old data
$data[] = $myDataValueFromDatabase;
# store the data in a PHP session variable so the data will not be deleted by PHP after
# this script ends
$_SESSION['xxx'] = $data;
Hope this can help.
Regards
Peter Kwan |