_QUERY_ERROR_You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND categoria = ORDER BY item_id asc LIMIT 0,1' at line 2

SQL: SELECT item_id FROM dinamo_portfolio_items WHERE item_id > AND categoria = ORDER BY item_id asc LIMIT 0,1