Error executing query: SELECT p.id as id,
ps.subcategory_id as subcategory_id,
ps.product_id as product_id
FROM produse as p
LEFT JOIN produse_subcategorii as ps
ON ps.product_id=p.id
WHERE ps.subcategory_id=
ORDER BY p.rank Error message: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY p.rank' at line 8