Rinomina il nome del campo nell'output:
$sql = "SELECT p.id,
p.name,
p.description,
p.price,
c.name AS OTHER_NAME,
p.sub
FROM products p
JOIN category c on p.category = c.id
ORDER by p.id";
E poi ottieni OTHER_NAME