Minase Posted October 23, 2009 Share Posted October 23, 2009 i'm a little stuck at this :| normally i would use $user->Gold to return the gold a user have but if i use SUM then something like this occurs stdClass Object ( [sUM(Gold)] => 227 ) and it should be just stdClass Object ( [Gold] => 227 ) in this way $user->Gold is not accessible. any ideas? ty Link to comment https://forums.phpfreaks.com/topic/178743-solved-question/ Share on other sites More sharing options...
Mark Baker Posted October 23, 2009 Share Posted October 23, 2009 In your sql query, assign a synonym SELECT userid, SUM(gold) as gold FROM table GROUP BY userid Link to comment https://forums.phpfreaks.com/topic/178743-solved-question/#findComment-942873 Share on other sites More sharing options...
Minase Posted October 23, 2009 Author Share Posted October 23, 2009 thanks Link to comment https://forums.phpfreaks.com/topic/178743-solved-question/#findComment-942882 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.