In PHP (and almost all programming languages) array indexes are unique. This means that $arr["teletubbies"] cannot be "lala" and "noonoo" at the same time. This is for the simple reason that if you would call $arr["teletubbies"] at a later time PHP cannot know whether you meant "lala" or "noonoo" then.
To solve this issue (you want some things ordered by their year, e.g. 2014) it is advisable to make the value correlated to key 2014 a new array, thus creating a multidimensional array. You seem to understand that, but your implementation is wrong, as you are now just changing $rows[strval($row['year'])] to something new instead of appending the new values.
There are multiple solutions to this problem to do so:
Solution 1:
$rows=array();
while($row = mysqli_fetch_array($result)) {
//The syntax [] means: insert after the last defined key, more information at: http://php.net/manual/en/language.types.array.php look for $arr[] = 56;
$rows[strval($row['year'])][] = array('month'=>$row['month'],'satisfaction'=>$row['sat_per_month']);
}
Solution 2:
$rows=array();
while($row = mysqli_fetch_array($result)) {
//Make sure $rows[strval($row['year'])] is an array
if (!isset($rows[strval($row['year'])])) $rows[strval($row['year'])] = Array();
//array_push pushes a new array element to the last element of an array, documentation here: http://php.net/manual/en/function.array-push.php
array_push($rows[strval($row['year'])],array('month'=>$row['month'],'satisfaction'=>$row['sat_per_month']));
}
There are probably several other solutions aswell, but you get the idea.
To call one of the $rows[strval($row['year'])] later, you must make sure you call the newly created indexes! For example:
//Three indexes! 1st is the year, 2nd is the nth child you added and third is Array("month" => "..", "satisfaction" => "...");
print_r($rows["2014"][5]);
or
echo $rows["2014"][3]["month"]." ".$rows["2014"][3]["satisfaction"];