An example of mysql function if statements