title: error inserting php to database using a jquery function option textarea
body: <p>Hi guys you have some idea about this codes, textarea submitted to database. because i have a connection.php but it is not inserting to database please help me using option textarea. Can you help me also for the phpmyadmin SQL what name, type, etc should i put, thanks</p>
  
  <p><strong>select.html</strong></p>
  
  <pre><code> &lt;html lang="en"&gt;
      &lt;title&gt;NTF Catering Service&lt;/title&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;            &lt;/script&gt; 
       &lt;script src="js/js.1.js" type="text/javascript"&gt;&lt;/script&gt;
       &lt;/head&gt;
     &lt;body&gt;
     &lt;form action="submit.php" method="post"&gt;
  
     &lt;select multiple="multiple" name="food" class="options" id="textarea"&gt;
           &lt;option name="foodA"value="foodA"&gt;foodA&lt;/option&gt;
             &lt;option name="foodB" value="foodB"&gt;foodB&lt;/option&gt;
                &lt;option name="foodC" value="foodC"&gt;foodC&lt;/option&gt;
                   &lt;option name="foodD" value="foodD"&gt;foodD&lt;/option&gt;
                       &lt;option name="foodE" value="foodE"&gt;foodE&lt;/option&gt;
      &lt;/select&gt;
  
  
         &lt;button type="button" id="copy" onclick="yourFunction()"&gt;Copy&lt;/button&gt;
         &lt;button type="button" id="remove" onclick="yourFunction()"&gt;Remove&lt;/button&gt;
  
            &lt;select id="textarea2" multiple class="remove" name="food"&gt;
  
  
        &lt;input type="submit" name="submit" /&gt;
        &lt;/form&gt;
         &lt;/select&gt;
          &lt;/html&gt;
  </code></pre>
  
  <p><strong>connection.php</strong></p>
  
  <pre><code>   &lt;?php
     $dbhost = "localhost";
     $dbuser = "root";
     $dbpass = "";
     $db = "copy";
  
     $conn = mysql_connect($dbhost,$dbuser,$dbpass);
     mysql_select_db($db);
      ?&gt;
  </code></pre>
  
  <p><strong>submit.php</strong></p>
  
  <pre><code>  &lt;?php
      include 'connection.php';
  
       $foodA = $_POST['foodA'];
       $foodB = $_POST['foodB'];
       $foodC = $_POST['foodC'];
       $foodD = $_POST['foodD'];
       $foodE = $_POST['foodE'];
  
  
    if(!$_POST['submit']) {
        echo "please fill out the form";
         header('Location: select.html');
      } else {
                $sql = "INSERT INTO remove(food1, food2, food3, food4, food5) VALUES ('".$food1."', '".$food2."', '".$food3."','".$food4."','".$food5."');";
             mysql_query($link, $sql);
        echo "User has been added!";
          header('Location: select.html');
  
    }
    ?&gt;
  </code></pre>