Couldn't execute query [Get Object info by ID] 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 'LIMIT 1' at line 4 (SELECT obj.t, COALESCE(par.t, 1) par_typ, COALESCE(par.id, 1) par_id, COALESCE(arr.id, -1) arr FROM pechenkin obj LEFT JOIN pechenkin par ON obj.up>1 AND par.id=obj.up LEFT JOIN pechenkin arr ON arr.up=par.t AND arr.t=obj.t WHERE obj.id= LIMIT 1; )