title: How do I allow user to add data to MySql database from JSP page in Netbeans
body: <p>I'm having some difficulty with getting user input into the mysql database from a jsp page.  I am currently working in netbeans and have a table with the following inputs:</p>
  
  <pre><code>containerinventory
  ID (int)
  containerNumber(varchar)
  FullOut(date)
  EmptyIn(date)
  EmptyOut(date)
  FullIn(date)
  Comments(varchar)
  </code></pre>
  
  <p>So I want to set up a form on my jsp page to allow users to add an item to inventory and input all the relevant information for all the fields listed in the above table.</p>
  
  <p>I've read about using PHP, but it seems like all of my PHP code when I try it on this page is commented out and not read.  I'm using 
  
  <p>I know that I am connected to the DB because I've put a SQL command to display everything in the DB, and I've added to the DB from the development side to verify.  </p>
  
  <p>How can I allow user input from a form to input into this database?  Any help would be greatly appriciated. I'd like the user to be able to enter all relevant information in a text box, click submit and have it added to the inventory.</p>
  
  <p>I'm not too familiar with PHP or JSP, so please be gentle :) Thanks for any help.  I know how to use a form within this code, and I've tried, but it does not pass through to the DB.</p>
  
  <p>So here is my code:</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  
  
  &lt;sql:query var="result" dataSource="jdbc/rukerttracker"&gt;
          SELECT * FROM containerinventory
     &lt;? &lt;div id="indexLeftColumn"&gt;
          &lt;div id="welcomeText"&gt;
              &lt;p&gt;[ Welcome Text ]&lt;/p&gt;
  
        &lt;!-- test to access context parameters --&gt;
      categoryImagePath: ${initParam.categoryImagePath}
      productImagePath: ${initParam.productImagePath}
  &lt;/div&gt;
          &lt;div style="height:50%;overflow:auto;"&gt;
          &lt;table border="1"&gt;
      &lt;!-- column headers --&gt;
      &lt;tr&gt;
      &lt;c:forEach var="columnName" items="${result.columnNames}"&gt;
          &lt;th&gt;&lt;c:out value="${columnName}"/&gt;&lt;/th&gt;
      &lt;/c:forEach&gt;
  &lt;/tr&gt;
  &lt;!-- column data --&gt;
  &lt;c:forEach var="row" items="${result.rowsByIndex}"&gt;
      &lt;tr&gt;
      &lt;c:forEach var="column" items="${row}"&gt;
          &lt;td&gt;&lt;c:out value="${column}"/&gt;&lt;/td&gt;
      &lt;/c:forEach&gt;
      &lt;/tr&gt;
  &lt;/c:forEach&gt;`enter code here`
  </code></pre>