Invalid query SELECT ft_wrk.* FROM w_p JOIN ft_wrk ON w_p.r=ft_wrk.id WHERE w_p.l= ORDER BY ft_wrk.seq LIMIT 1: 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 ft_wrk.seq LIMIT 1' at line 1