我在 MYSQL 中遇到错误
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
有人可以向我解释这个错误是怎么回事吗?谢谢。
PHP代码:
<?php
$link = connectToDB();
$strXML = "<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units'>";
$result = mysqli_query($link, "SELECT DISTINCT PROFILE FROM tbljocreator GROUP BY PROFILE");
$show = mysqli_fetch_array($result);
if($result) {
while ($ors = mysqli_fetch_array($result)) {
$strQuery = "select PROFILE, sum(MT) as totalLM from tbljocreator where PROFILE =" .$ors['PROFILE'];
$result2 = mysqli_query($link, $strQuery) or die(mysqli_error($link));
$getresult2 = mysqli_fetch_array($result2);
$strXML .= "<set label='" . $ors['profile'] . "' value ='" . $getresult2['totalLM'] . "' />";
mysqli_free_result($result2);
}
}
mysqli_close($link);
$strXML .= "</chart>";
echo renderChart("FusionCharts/Column3D.swf", "", $strXML, "JoCreator", 450, 300, false, true);
?>
请为我解释清楚。