the questions, why example 1 works and example 2 doesn't I want to use the second variant
example1
$query = "SELECT i.category_id, h.line
FROM litline i
LEFT JOIN links as h ON (i.category_id = h.id)";
example 2
$query = "SELECT i.category, h.line
FROM litline i
LEFT JOIN links as h ON (i.category = h.name)";
please any suggestions, thanks