Cannot retrieve values from LEFT JOIN (2 tables)
a_horse_with_no_name already provided with the answer.

But to disable this "one of those stupid MySQL "features" that no one can really understand", you can set sql_mode to be more strict about it. Consider the following setup in your my.cnf config file:

[mysqld]
sql_mode = ONLY_FULL_GROUP_BY


See documentation. This will not allow you to reference non-grouped columns unless with an aggregation function.