title: Using Flot jquery plugin with PHP and MySQL
body: <p>I'm trying to get a jquery flot simple line graph to work using MySQL, PHP and jquery.<br>
  I am only getting a blank chart with no plotted points or line. As far as I can tell, everything should be correct in the code, but I'd like to see what I'm missing.</p>
  
  <p>See the code below. Appreciate the help!</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
  &lt;style type="text/css"&gt;
  body { font-family: Verdana, Arial, sans-serif; font-size: 12px; }
  #placeholder { width: 450px; height: 200px; }
  &lt;/style&gt;
  
  
  &lt;script type="text/javascript" language="javascript" src="../js/jquery-1.9.1.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript" src="../flot/jquery.flot.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  
  $lineqry = 
  
  "SELECT
  dsmp.metric_date,
  dsmp.metric_value
  FROM applications.daily_scorecard_metric_performance dsmp
  
  $lres = mysql_query ($lineqry,$prod);
  $lrow = mysql_fetch_array($lres);
  
     while($lrow = mysql_fetch_assoc($lres)) 
   {
      $lineset[] = array($lrow['metric_date'],$lrow['metric_value']);
  }
  ?&gt;
  
  
  &lt;script type="text/javascript"&gt;
  var plotdata = &lt;?php echo json_encode($lineset);?&gt;;
  
  $(function () {
  $.plot($("#placeholder"), [ plotdata ]);
  });
  &lt;/script&gt;
  
  &lt;div id="placeholder"&gt;&lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here's and example output of the array <code>$lineresult</code> in PHP:</p>
  
  <pre><code>array(9) { [0]=&gt; array(2) { [0]=&gt; string(10) "2013-09-30" [1]=&gt; string(1) "0" } [1]=&gt; array(2) { [0]=&gt; string(10) "2013-10-01" [1]=&gt; string(3) "423" } [2]=&gt; array(2) { [0]=&gt; string(10) "2013-10-02" [1]=&gt; string(3) "404" } [3]=&gt; array(2) { [0]=&gt; string(10) "2013-10-03" [1]=&gt; string(3) "428" } [4]=&gt; array(2) { [0]=&gt; string(10) "2013-10-04" [1]=&gt; string(3) "353" } [5]=&gt; array(2) { [0]=&gt; string(10) "2013-10-05" [1]=&gt; string(3) "190" } [6]=&gt; array(2) { [0]=&gt; string(10) "2013-10-06" [1]=&gt; string(3) "315" } [7]=&gt; array(2) { [0]=&gt; string(10) "2013-10-07" [1]=&gt; string(3) "531" } [8]=&gt; array(2) { [0]=&gt; string(10) "2013-10-08" [1]=&gt; string(3) "520" } } 
  </code></pre>
  
  <p>here's the output of the json_encode:</p>
  
  <pre><code>[["2013-09-30","0"],["2013-10-01","423"],["2013-10-02","404"],["2013-10-03","428"],["2013-10-04","353"],["2013-10-05","190"],["2013-10-06","315"],["2013-10-07","531"],["2013-10-08","520"]] 
  </code></pre>