"SELECT parent.name
FROM categories AS node,
categories AS parent
WHERE node.left_node BETWEEN parent.left_node AND parent.right_node
AND node.name = '{$node_name}'
ORDER BY parent.right_node AND node.left_node"
The query above will display all the parent to the root of the node called. I only want to get the next parent, not all the way to the root, but only node above. for instance in the graphic below

If I call RED the statement will pull Fruit and Food, but instead I would like to structure the query to only pull the very next node to RED only which is “Fruit”, don’t need root node “Food”.
You could exploit the fact that a any nodes left value is greater than that of it’s parent (or that the right value is less than its parent), and use limit to just return what you want.
this is mysql synax, i’m not sure what rdbms you are using.
It seems to me like there is probably a better way.