Its not a PHP thing, its standard SQL.... anyway, when your compose a SQL Select query that uses multiple tables you need to set a new name to the fields/tables (aliasing).
For example if you have a table called 'employees' and another one called 'department' and you want to select 2 fields from 'employees' and just one from 'department' you may write this:
SELECT e.firstname as firstname,
e.lastname as lastname,
d.department_name as dept_name
FROM employees e,
department d
WHERE -- whatever in here
as you can see I have aliased the table name employee as 'e' and department as 'd', I have also aliased all the fields (the name after the as keyword).
So with that said, you can now refer to the aliased name in PHP, like this:
$result_array['aliased_name'];