That's because Bob Long is the only set of values in the array. Your associative array is:
array(
"name" => "Joe",
"surname" => "Soap",
"name" => "Bob",
"surname"=>"Long")
Only one value per key, so "Joe" gets replaced by "Bob" and "Soap" gets replaced by "Long".
So it's probably just a bit of typographical confusion. Try a first line of
$data = array(
array("name" => "Joe", "surname" => "Soap"),
array("name" => "Bob", "surname"=>"Long")
);
or
$data[] = array("name" => "Joe", "surname" => "Soap");
$data[] = array("name" => "Bob", "surname"=>"Long");
if $data is initially empy, or it's not and you want to reatin what elements it already has.