Hello,
I keep getting the following error when I output the code below: Notice: Undefined property: stdClass::$coun t
How can I output COUNT(name) in an array?
Thanks for your assistance.
I keep getting the following error when I output the code below: Notice: Undefined property: stdClass::$coun t
Code:
$sql = "SELECT COUNT(name), name FROM searches GROUP BY name";
$result = mysql_query( $sql );
while($obj = mysql_fetch_object( $result ) ) {
$pop_players = array();
$pop_players['COUNT(name)'] = $obj->count;
$pop_players['name'] = $obj->name;
$pop_players_two[] = $pop_players;
}
Thanks for your assistance.
Comment