This is some custom php queries to moodles database