This would depend on how you retrieve the results of the MySQL select.
It looks like $salespersons->data_out is a numerically indexed array. That means you refer to its elements by numbers. E.g.,
$salespersons->data_out[0]
$salespersons->data_out[1]
$salespersons->data_out[2]
etc.
It looks like each element within $salespersons->data_out is an associatively indexed array. I.e., you refer to its elements using a string or associative key like "Firstname".
You can easily inspect the contents of an associative array using [man]var_dump[/man] or [man]print_r[/man] or [man]var_export[/man].
You can inspect the keys of some array using [man]array_keys[/man].
You can manually iterate through the values of an associative array and get its keys at the same time like so:
// outputs all the values associated with person 0
foreach($salespersons->data_out[0] as $key => $value) {
echo $key . " has a value of " . $value . "\n";
}