saving javascript code to database table, and retrieving it
<p>Everyone know about Google Analytics tracking code. It's a javascript code similar to one below:</p>

<pre><code>&lt;script type="text/javascript"&gt; 

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
      _gaq.push(['_trackPageview']);

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

    &lt;/script&gt; 
</code></pre>

<p>How can I save following code (or any javascript code, with html tags and comments) to MySQL Table. </p>

<p>Table structure is as follows:</p>

<pre><code>id    int
code  text
</code></pre>

<p>should I write query as:</p>

<pre><code>insert into temp values(1,'&lt;script..........');
</code></pre>

<p>but I think, query would break, and there are chances that un-sanitized data might get store.</p>

<p>So, How can I say any JavaScript, or HTML tag in text field of a table.</p>
