我试图打印我的 PHP 对象 '$mon' 的值,它具有所有月份的平均值.....
我的数据获取代码是
$result = mysql_query("SELECT b_year, sum(m1) as m1, sum(m2) as m2, sum(m3) as m3, sum(m4) as m4, sum(m5) as m5, sum(m6) as m6, sum(m7) as m7, sum(m8) as m8, sum(m9) as m9, sum(m10) as m10, sum(m11) as m11, sum(m12) as m12
from s_budgets as b INNER JOIN users as u on b.u_id = u.id WHERE b_year=YEAR( CURDATE( ) )
GROUP BY b_year " );
$mon=mysql_fetch_array($result)
我的显示这些值的代码如下......
<?php echo $mon->m4;?>,
<?php echo $mon->m5;?>,
<?php echo $mon->m6;?>,
如何打印具有多个属性的对象“$mon”?