Depends on what you expect to happen next. You can act both in PHP, manipulating the returned array result, or you can change your SQL so that sql returns the first and last name as one column, respectively as one value.
I would go with mysql change of the select statement like this.
$result = mysql_query("SELECT id, concat(first, ' ',last) as fullname FROM agents ORDER BY agents.id");
This code will return the first and last names with space between them.
Then you can access the fullname as associative array, using e.g.
$result_from_query['fullname'];
Try and advise if it works for you.
Also advise if you shall need to separate the names again e.g. during submit or something.