如题,先谢谢了。
直接放到模板需要的地方
{php} $earnings = query("select sum(money) as ein from `qb_moneylog` where uid = $userdb[uid] and money > 0 " ); $expend = query("select sum(money) as eout from `qb_moneylog` where uid = $userdb[uid] and money < 0 "); {/php} 总收入:{$earnings[0]['ein']} <br /> 总支出:{$expend[0]['eout']}