title: put the value of radio button and checkbox into 1 row in database via php
body: <p>how to insert the value of radio button and checkbox together into 1 row database..for example the table contains name of menu and the size of the food. The Database table contains food and price..so when we choose which menu we want with checkbox, the value of checkbox will store in food(database's table) and choose the size of our food use radio button, the value of radiobutton will store in price(database's table)</p>
  
  <p>please help me
  I'm a newbie in this field
  thanks</p>
  
  <p>here is the code</p>
  
  <p>menu.php</p>
  
  <pre><code>&lt;form action="price.php" method="post"&gt;
  
  Menu : &lt;br&gt;
  &lt;input type="checkbox" value="Siomay" name="tile[]"&gt;Siomay &lt;br&gt;
  &lt;input type="radio" name="field" value="4" /&gt;Small
  &lt;input type="radio" name="fiel" value="5" /&gt;Large&lt;br&gt;
  
  
  &lt;input name="confirm" type=submit id="confirm" value='Confirm'&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>price.php</p>
  
  <pre><code>&lt;?php
  $con = mysql_connect("localhost","root");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  mysql_select_db("project1", $con);
  
  $insert="INSERT INTO menu(name, price) VALUES ('".$_POST['tile']"','".$_POST['field']"')";
  
  if (!mysql_query($insert, $con))
  {
  die('Error: ' . mysql_error());
  }
  echo "1 record added";
  mysql_close($con) 
  ?&gt;
  </code></pre>