title: creating charts with pchart and mysql - correct syntax from example provided
body: <p>I am trying to generate a chart based on the example provided by pchart. Here is my code:</p>
  
  <pre><code>&lt;?php
  /* Include the pData class */
  
  include("pchart/class/pData.class.php");
  
  /* Create the pData object */
  
  $myData = new pData();  
  
  /* Connect to the MySQL database */
  
  $db = mysql_connect("webhost", "user", "pass");
  
  mysql_select_db("database",$db);
  
  
  /* Build the query that will returns the data to graph */
  
  $Requete = "SELECT * FROM `replies` WHERE `field` LIKE CONCAT ('%', Do you an interest in Green IT, '%')";
  
  $Result  = mysql_query($Requete,$db);
  
  $Yes=""; $No=""; $Undecided="";
  
  while($row = mysql_fetch_array($Result));
  
  {
  
  
  /* Push the results of the query in an array */
  $Yes[]   = $row["Yes"];
  $No[] = $row["No"];
  $Undecided[]    = $row["Undecided"];
  }
  
  
  
  /* Save the data in the pData array */
  
  $myData-&gt;addPoints($Yes,"Yes");
  
  $myData-&gt;addPoints($No,"No");
  
  $myData-&gt;addPoints($Undecided,"Undecided");
  
  ?&gt;
  </code></pre>
  
  <p>The error I'm getting is this:</p>
  
  <pre><code>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a4728588/public_html/charts.php on line 30
  </code></pre>
  
  <p>Which points to: </p>
  
  <pre><code>while($row = mysql_fetch_array($Result));
  </code></pre>
  
  <p>Any ideas on how to fix this so the chart is generated?</p>
  
  <p>Thanks in advance</p>