title: Save <script></script> in mysql database with php
body: <p>I have a cms that I am working on for a client, he wants to add a code textbox so he can paste special code for pages on a page by page basis. So, I need to be able to give the user a way to input javascript tags into a page they are editing.  When that page loads, the java code will show and run.</p>
  
  <p>For example, Facebook code - it would be pasted into this code textarea and saved in the mysql database.</p>
  
  <p>Note - the site is still using mysql_query and has not been converted, client has been told but they have no interest in updating so need the example done in mysql_query.</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));&lt;/script&gt;
  </code></pre>
  
  <p>How can I safely save this to the database without breaking the javascript?</p>
  
  <p>thanks!</p>