มันขึ้น error คะ พี่ช่วยแนะนำหน่อยคะ จนปัญญาจริงๆว่าเป็นเพราะอะไรคะ
หนูทำกราฟคะ แล้วมันขึ้น error ยังงี้คะ 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 ไม่ทราบว่าผิดตรงไหนคะ
Code (PHP)
<?php
//We've included ../Includes/FusionCharts.php and ../Includes/DBConn.php, which contains
//functions to help us easily embed the charts and connect to a database.
include("../Includes/FusionCharts.php");
include("../Includes/DBConn.php");
?>
<HTML>
<HEAD>
<TITLE>::ระบบรับส่งข้อมูลlab online::</TITLE>
<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-image: url(../../../image/background.gif);
background-repeat: repeat;
}
.text{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.style1 {
color: #000000;
font-size: x-large;
font-weight: bold;
}
.style2 { color: #6600FF;
font-size: 36px;
font-weight: bold;
font-family: AngsanaUPC;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style11 {
font-family: "Angsana New";
font-weight: bold;
color: #A9DBF6;
}
.style12 {color: #000000}
.style13 {font-family: "Angsana New"}
.style14 {font-size: 36px}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"></HEAD>
<BODY>
<br>
<table width="47%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="46" background="../../../image/bgr.png"><div align="center" class="style1"><span class="style2"><span class="style12">แสดงสรุปรายงานุ</span></span><span class="style13"><span class="style14"> [แผนภูมวงกลม]</span></span></div></td>
</tr>
<tr>
<td bgcolor="#FFFFCC"><div align="center">
<?php
$link = connectToDB();
$animateChart = $_GET['animate'];
if ($animateChart=="")
$animateChart = "1";
$strXML = "<chart caption='' subCaption='' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix='คน' animation=' " . $animateChart . "'>";
$strQuery = "select * from userlog";
$result = mysql_query($strQuery) or die(mysql_error());
//Iterate through each factory
if ($result) {
while($ors = mysql_fetch_array($result)) {
//Now create a second query to get details for this factory
$strQuery = "select count(id) as TotOutput from inbox where name=" . $ors['userto'];
$result2 = mysql_query($strQuery) or die(mysql_error());
$ors2 = mysql_fetch_array($result2);
//Generate <set label='..' value='..' />
$strXML .= "<set label='" . $ors['name'] . "' value='" . $ors2['TotOutput'] . "' />";
//free the resultset
mysql_free_result($result2);
}
}
mysql_close($link);
$strXML .= "</chart>";
echo renderChart("../../FusionCharts/Pie3D.swf", "", $strXML, "FactorySum", 800, 400, false, false);
?>
</div></td>
</tr>
<tr>
<td height="26" background="../../../image/2.png"> </td>
</tr>
</table>
<h2 align="left"> <div align="center" ><span class="style11"><a href="../../../admincheckwork.php">กลับ</a></span></div>
</h2>
</BODY>
</HTML>
Tag : PHP, MySQL
Date :
2011-12-19 14:29:45
By :
ผิดพลาด
View :
812
Reply :
1
ยังงี่รึป่าวครับ
Code (PHP)
$strQuery = "select count(id) as TotOutput from inbox where name='". $ors['userto']."' " ;
Date :
2011-12-19 14:48:30
By :
chonburi f.c
Load balance : Server 03