title: PHP/mySQL - how to encode/decode/escape/whatever needed strings safely before inserting on database
body: <p>My problem is this: I have a database where all fields are VARCHAR. Some represent html code. This code contains chars like ◉, ⬛︎, ◔, ➜, ★, ✦, etc. These characters are not encoded on the HTML. They are like you see them here.</p>
  
  <p>Other fields on that database are URLs. </p>
  
  <p>I know I have to escape these chars to prevent sql-injection and also have to encode them to allow insertion on the database.</p>
  
  <p><code>htmlspecialchars</code> will not handle these symbols because they are not encoded on the source. <code>mysql_escape_string</code> will only escape bars and double quotes, etc.</p>
  
  <p>How do I really encode this and escape in <code>PHP</code> so I can insert this data on the database and how do I read them back?</p>
  
  <p>thanks.</p>