put the value of radio button and check box into database PHP
I would like to try insert the value of checkbox and radio button into my database...when I choose the option of checkbox and choose the option of radio button, the value of checkbox and radio button will recorded in the same row in database...I have 3 menu choices..each menu have 2 size options which is radio button..that's mean for each size option there should have different name right??...the name I mean is field1[]....

this is my code

please help me...I'm a newbie in this field

resto.php
    <form action="menu2.php" method="post">

    Menu : <br>
    <input type="checkbox" value="Siomay" name="tile[]">Siomay <br>
		<input type="radio" name="field1[]" value="4" />Small
		<input type="radio" name="field1[]" value="5" />Large<br>
    <input type="checkbox" value="Batagor" name="tile[]">Batagor <br>
		<input type="radio" name="field2[]" value="4" />Small
		<input type="radio" name="field2[]" value="5" />Large<br>
    <input type="checkbox" value="Pempek" name="tile[]">Pempek<br>
		<input type="radio" name="field3[]" value="4" />Small
		<input type="radio" name="field3[]" value="5" />Large<br>


    <input name="confirm" type=submit id="confirm" value='Confirm'>

    </form>

menu2.php

    <?php
    $con = mysql_connect("localhost","root");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    mysql_select_db("project1", $con);

    $Tile = mysql_real_escape_string($_POST['tile']);
    $Field = mysql_real_escape_string($_POST['field1']);

    if ( !empty($Tile) && !empty($Field) )
    {
      $insert="INSERT INTO menu(name, price) VALUES ('$Tile','$Field')";
      if (!mysql_query($insert, $con))
        {
        die('Error: ' . mysql_error());
        }
    echo "1 record added";
    }
    else echo "Please select at least 1 menu.";

    mysql_close($con) 
    ?>


put the value of radio button and check box into database PHP
===

I would like to try insert the value of checkbox and radio button into my database...when I choose the option of checkbox and choose the option of radio button, the value of checkbox and radio button will recorded in the same row in database...I have 3 menu choices..each menu have 2 size options which is radio button..that's mean for each size option there should have different name right??...the name I mean is field1[]....

this is my code

please help me...I'm a newbie in this field

resto.php
    <form action="menu2.php" method="post">

    Menu : <br>
    <input type="checkbox" value="Siomay" name="tile[]">Siomay <br>
		<input type="radio" name="field1[]" value="4" />Small
		<input type="radio" name="field1[]" value="5" />Large<br>
    <input type="checkbox" value="Batagor" name="tile[]">Batagor <br>
		<input type="radio" name="field2[]" value="4" />Small
		<input type="radio" name="field2[]" value="5" />Large<br>
    <input type="checkbox" value="Pempek" name="tile[]">Pempek<br>
		<input type="radio" name="field3[]" value="4" />Small
		<input type="radio" name="field3[]" value="5" />Large<br>


    <input name="confirm" type=submit id="confirm" value='Confirm'>

    </form>

menu2.php

    <?php
    $con = mysql_connect("localhost","root");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    mysql_select_db("project1", $con);

    $Tile = mysql_real_escape_string($_POST['tile']);
    $Field = mysql_real_escape_string($_POST['field1']);

    if ( !empty($Tile) && !empty($Field) )
    {
      $insert="INSERT INTO menu(name, price) VALUES ('$Tile','$Field')";
      if (!mysql_query($insert, $con))
        {
        die('Error: ' . mysql_error());
        }
    echo "1 record added";
    }
    else echo "Please select at least 1 menu.";

    mysql_close($con) 
    ?>

