title: how to insert data in database using tinymce
body: <p>This are my codes for <code>TinyMCE</code>, when I intend to submit it doesn't appear on the database and what datatype should I put in the table:</p>
  
  <pre><code>&lt; CONNECTION TO DATABASE?&gt;
  
  &lt;!-- Load jQuery --&gt;
  &lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  google.load("jquery", "1");
  &lt;/script&gt;
  
  &lt;!-- Load TinyMCE --&gt;
  &lt;script type="text/javascript" src="../jscripts/tiny_mce/jquery.tinymce.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  $().ready(function() {
      $('textarea.tinymce').tinymce({
          // Location of TinyMCE script
          script_url : '../jscripts/tiny_mce/tiny_mce.js',
  
          // General options
          theme : "advanced",
          plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,advlist",
  
          // Theme options
          theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
          theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
          theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
          theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
          theme_advanced_toolbar_location : "top",
          theme_advanced_toolbar_align : "left",
          theme_advanced_statusbar_location : "bottom",
          theme_advanced_resizing : true,
  
          // Example content CSS (should be your site CSS)
          content_css : "css/content.css",
  
          // Drop lists for link/image/media/template dialogs
          template_external_list_url : "lists/template_list.js",
          external_link_list_url : "lists/link_list.js",
          external_image_list_url : "lists/image_list.js",
          media_external_list_url : "lists/media_list.js",
  
          // Replace values for the template plugin
          template_replace_values : {
              username : "Some User",
              staffid : "991234"
          }
      });
  });
  &lt;/script&gt;
  &lt;!-- /TinyMCE --&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;form name="insert" method="post" action="insert.php"&gt;
  
          &lt;textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%" class="tinymce"&gt;
  
          &lt;/textarea&gt;
      &lt;/div&gt;
  
      &lt;!-- Some integration calls --&gt;
      &lt;a href="javascript:;" onclick="$('#elm1').tinymce().show();return false;"&gt;[Show]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="$('#elm1').tinymce().hide();return false;"&gt;[Hide]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="$('#elm1').tinymce().execCommand('Bold');return false;"&gt;[Bold]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="alert($('#elm1').html());return false;"&gt;[Get contents]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="alert($('#elm1').tinymce().selection.getContent());return false;"&gt;[Get selected HTML]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="alert($('#elm1').tinymce().selection.getContent({format : 'text'}));return false;"&gt;[Get selected text]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="alert($('#elm1').tinymce().selection.getNode().nodeName);return false;"&gt;[Get selected element]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="$('#elm1').tinymce().execCommand('mceInsertContent',false,'&lt;b&gt;Hello world!!&lt;/b&gt;');return false;"&gt;[Insert HTML]&lt;/a&gt;
      &lt;a href="javascript:;" onclick="$('#elm1').tinymce().execCommand('mceReplaceContent',false,'&lt;b&gt;{$selection}&lt;/b&gt;');return false;"&gt;[Replace selection]&lt;/a&gt;
  
      &lt;br /&gt;
      &lt;input type="submit" name="save" value="Submit" /&gt;
      &lt;input type="reset" name="reset" value="Reset" /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;script type="text/javascript"&gt;
  if (document.location.protocol == 'file:') {
  alert("The examples might not work properly on the local file system due to security   settings in your browser. Please use a real webserver.");
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is the codes for the <code>insert.php</code>:</p>
  
  <pre><code>&lt;?php
  require_once("connection.php");
  $content = $_POST['elm1'];
  
  
  
  $insertSQL="INSERT INTO table (content) VALUES ('".$content."')";
  
  if (!mysql_query($insertSQL,$db_server)) echo "Insert failed: $insertSQL &lt;br /&gt;".
  mysql_error()."&lt;br /&gt;&lt;br /&gt;";
  
  header("Location:index.php");  
  ?&gt;
  </code></pre>
  
  <p>What am I supposed to do? Need help, Thanks a lot</p>