title: php mysql how to insert auto generated field form
body: <p>I am a new php beginner am working on a lottery project..which i have 5 input text field on each draw and which total draw is 10 draw and 9 is hiding it only display when the player select number of draw to play...</p>
  
  <p>The problem am having here is how will i insert the 5 picking number into database when.. this what i did </p>
  
  <pre><code>$game1 = (int) $_POST['game1_mainball3'] . "-" . (int) $_POST['game1_mainball2'] . "-" . (int) $_POST['game1_mainball3'] . "-" . (int) $_POST['game1_mainball4'] . "-" . (int) $_POST['game1_mainball5'];
  </code></pre>
  
  <p>which i var default draw  as <code>$game1</code> when in insert data it only insert <code>$_POST['game1_mainball3']</code> in to the column </p>
  
  <p>this my insert code </p>
  
  <pre><code>   $sql = "INSERT INTO tickets (drawdate, drawtime, ticket_no) VALUES ('$drawdate','$drawtime','$game1')";
     mysql_query($sql);
  </code></pre>
  
  <p>i realy appricate ur replys..but am think maybe am the one have problem with my form name maybe that what affecting it here is the form am posting  </p>
  
  Game 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <strong>OR</strong>
              
              
               <strong>Game Type</strong>
              
              &nbsp;
              
              <strong>At</strong>
              
              &nbsp;
              
              <br>
  
  <pre><code>        &lt;div class="fields" id="game_set_2" style="display: none;"&gt;&lt;div class="lotto_game"&gt;Game 2&lt;/div&gt;&lt;input onkeypress="return EnterKeyHandler(this, event)" type="text" title="Game 2 - Ball 1" class="text_num" name="game2_mainball1" id="game2_mainball1" maxlength="2"&gt;&amp;nbsp;&lt;input onkeypress="return EnterKeyHandler(this, event)" type="text" title="Game 2 - Ball 2" class="text_num" name="game2_mainball2" id="game2_mainball2" maxlength="2"&gt;&amp;nbsp;&lt;input onkeypress="return EnterKeyHandler(this, event)" type="text" title="Game 2 - Ball 3" class="text_num" name="game2_mainball3" id="game2_mainball3" maxlength="2"&gt;&amp;nbsp;&lt;input onkeypress="return EnterKeyHandler(this, event)" type="text" title="Game 2 - Ball 4" class="text_num" name="game2_mainball4" id="game2_mainball4" maxlength="2"&gt;&amp;nbsp;&lt;input onkeypress="return EnterKeyHandler(this, event)" type="text" title="Game 2 - Ball 5" class="text_num" name="game2_mainball5" id="game2_mainball5" maxlength="2"&gt;&amp;nbsp;&lt;span class="quickpick" style="display: inline;"&gt;
          &lt;strong&gt;OR&lt;/strong&gt;
          &lt;input type="button" name="quickpick" class="btn light" value="Quick Pick" onclick="QuickPick(2, 5, 0, 90, 0)"&gt;
          &lt;/span&gt;
           &lt;strong&gt;Game Type&lt;/strong&gt;
          &lt;input type="text" class="text_small" readonly="readonly" name="gametypeform2" value="Perm" maxlength="10"&gt;
          &amp;nbsp;
          &lt;/span&gt;
          &lt;strong&gt;At&lt;/strong&gt;
          &lt;input onkeypress="return EnterKeyHandler(this, event)" type="text" title="price" class="text_small" name="game2_price" id="game2_price" maxlength="5" /&gt;
          &amp;nbsp;
          &lt;br&gt;
          &lt;/div&gt;
  </code></pre>