title: How to prevent apostrophe from being removed PHP MySQL
body: <p>I have a registration system which requests a users name.  Some people have an apostrophe in their surname and it's preventing the data from being written to the MySQL database table (e.g. O'Hare).</p>
  
  <p>I am using mysql_real_escape_string which is removing the apostrophe from the string.  This would be fine except I need to use the value with the apostrophe against a Web Service, otherwise the Web Service will return false.</p>
  
  <p>I was thinking I could do the name check with the Web Service before using mysql_real_escape_string, but could this present a security flaw?  Or do SOAP Web Services already do their own checks for clean inputs?</p>
  
  <p>Or is there a better way of passing through the variable whereby PHP retains the apostrophe but still keeps it secure and MySQL can accept it?</p>