在PHP中,我返回两列的总和并返回一个对象:
stdClass Object ( [sum(`total`)] => 54.00 [sum(`word_count`)] => 90 )
我正试图用foreach
来解决这个问题foreach($Classified as $classified) {
echo $classified->total;
echo $classified->sum;
}
返回错误:注意:尝试获取非对象的属性。我怀疑总和是以某种方式抛弃了它?