我正在尝试根据 pchart 提供的示例生成图表。这是我的代码:
<?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->addPoints($Yes,"Yes");
$myData->addPoints($No,"No");
$myData->addPoints($Undecided,"Undecided");
?>
我得到的错误是:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a4728588/public_html/charts.php on line 30
这指向:
while($row = mysql_fetch_array($Result));
关于如何解决这个问题以便生成图表的任何想法?
提前致谢