This should fix your SQL problems, I think