HOME > PHP > PHP Forum > code ที่มัน Error ใครรู้ช่วยหน่อยครับ Code Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in
code ที่มัน Error ใครรู้ช่วยหน่อยครับ Code Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in
/*
$strSql="SECECT Distinct GroupName FROM usergroup u";
$result = mysql_query($strSql);
echo $year;
echo "<table border = 1>";
while($row = mysql_fetch_array($result,MYSQL_ASSOC)){
echo"<tr><td>".$row["GroupName"]."<td>";
for($month=1;$month<=12;$month++) {
$strSql2= " SELECT GroupName,Year(AcctStartTime)As year,Month(AcctStartTime)As month ,Count(*)As Count FROM radius.radacct, radius.usergroup u where radius.UserName= u.UserName Group by GroupName,Year(AcctStartTime),Month(AcctStarTime) Having year = ".$year."and month = ".Month."and GroupName = ".$row["GroupName"]."";
$result2 = mysql_query($strSql2);
$num_rows = mysql_num_rows($result2);
if($num_row == 0) {
$row2["Count"]=0;
}
else{
$row2=mysql_fetch_array($result2);
}
echo "<td>".$row2["Count"]."</td>";
}
echo "</tr>";
}
echo "</table>";
*/
$data =array();
$strSql="SELECT GroupName,Year(AcctStartTime)As year,Month(AcctStartTime)As month,Count(*)As count From radius.radacct,radius.Usergroup u where radacct.UserName = u.UserName Group by GroupName,Year(AcctStartTime),Month(AcctStarTime) Having year = ".$year."";
1. Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Krasnoyarsk' for '7.0/no DST' instead in C:\AppServ\www\test.php on line 3
2. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\test.php on line 48
2009UserName Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
3. Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\test.php on line 98