php function for creating course. Checks if course exists, and if it doesn't, adds it to the COURSES database and has creating user join.