It has everything to do with names. Among the things that programmers sometimes believe about names, as in this case, is <i>that when you stick apostrophes around them they are always a valid SQL string literal</i>.