I don't reply 'for the sake of replying'. I was trying to be helpful.
You are confusing the fact that PHP is server side and javascript is client side. Hence, in order to get a php variable into javascript, you just print the variable into a place where the javascript can find it - like in the script itself.
do whatever you want to get you variable out of your database. then in the appropriate area do something like:
<?
//make your DB variable look like this
$var1="SPD";
$var2=298;
//then print this in the appropriate place
print ("chart1.addEntry(\"$var1\",$var2)");
?>
when you are finished, check your source and see that the source has printed properly. If not, then adjust your print statement so that it looks as required.
I hope that was more helpful.