I have to append more values to the associative array, the values are getting overwritten and I can see only last value displayed.
My snippet is :
$sql= "SELECT MONTHNAME(dt),SUM(dist) FROM demo GROUP BY MONTHNAME(dt) ";
$result=mysql_query($sql,$con) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$values=array($row['MONTHNAME(dt)'] => $row['SUM(dist)']);
}
I expect other values also to be present the array $values, but it is not happening.