I ran into this problem lately and I hope this can help you out..
Problem
INSERT INTO tbl_lang (enname,code,charset,inorder) VALUES (‘asd’,'asd’,'asd’,(SELECT MAX(inorder)+1 from tbl_lang))
Fix:
INSERT INTO tbl_lang (enname,code,charset,inorder) VALUES (‘asd’,'asd’,'asd’,(SELECT MAX(inorder)+1 from tbl_lang as l))

