You have a couple of things fighting in your strings.
mysql_real_escape_string()
)It's also possible that the single-quoted value is not present in the parameters to the first query. Your example is a proper name, after all, and only the second query seems to be dealing with names.