End of the day they are inserted into the tables themselves in the first place so cant see any reason why not (dont quote me on that as Im by no means an expert on xenforo lol). However Im sure there must be a better solution than using raw sql. If you have a working PHP script why would you want to use raw sql? Just out of curiousity