title: PHP Store variables in an array
body: <p>I am trying to save the variable score in the $chartdata[0] array.  If I put in a regular value let's say "20", i have no problem.  However, when I try to reference the $score variable the values do not get stored in the array.  It works fine if I use the random function and even when I echo out score I can see my values coming out fine.  What am I doing wrong?</p>
  
  <pre><code>while ($i &lt; 5) {
    $date=mysql_result($result,$i,"date");
    $score=mysql_result($result,$i,"rating_score");
    echo $score;
    $chartData[0][] = $score;
    $chartData[1][] = rand(250,4000);
    $chartData[2][] = rand(250,4000);
    $categories[$i] = 'Label-' . $i;
    $i++;
  }
  </code></pre>
  
  <p>The page is here: <a href="http://www.thelocalgolfer.com/chart/" rel="nofollow">http://www.thelocalgolfer.com/chart/</a></p>