The table prefix isn't included in the keys of the associative array returned by
fetch_assoc(), they just have the column names. So if you select both
c.name, there will just be one
$row['name'], which contains the last one in the
To get both, you should give one of them an alias.
$SQL = "SELECT s.id, s.name, s.description, s.hours, c.name AS career_name FROM subjects s JOIN careers c ON (s.career_id = c.id)";
Then you can use