title: PHP get input , radio , selection data and insert into MySQL table
body: <p>i'm new to php , i have been searching for a tutorial regarding inserting form's input(text) , radio and selection data to MySQL database's table using php. i found some tutorials but most are confusing. So i decided to ask.</p>
  
  <p>Okay here's what i want to do. I have a form which have two types of input and a selection
  1. input type text
  2. input type radio
  3. selection</p>
  
  <p>Here's the HTML code :</p>
  
  <pre><code>&lt;form action="" method="post" enctype="multipart/form-data"&gt;
  
    &lt;strong&gt;Your Name: &lt;/strong&gt;&lt;br&gt;
       &lt;input type="text" name="myname" value="" /&gt;
    &lt;br /&gt;&lt;br/&gt;    
  
    &lt;strong&gt;Which class type you want:&lt;/strong&gt;&lt;br&gt;
      &lt;select name="selection"&gt;
        &lt;option value="A"&gt;A&lt;/option&gt;
        &lt;option value="B"&gt;B&lt;/option&gt;
        &lt;option value="C"&gt;C&lt;/option&gt;
      &lt;/select&gt;
  
    &lt;strong&gt;Do you agree?&lt;/strong&gt;&lt;br&gt;
      &lt;input type="radio" name="agree" value="Yes"&gt; or 
      &lt;input type="radio" name="agree" value="No"&gt;
  
  
    &lt;input type="submit" name="submit" value="Submit"&gt;
  
  &lt;/form&gt;  
  </code></pre>
  
  <p>I have set the form action to blank because the php code will be in the same file as the HTML (it's a php file btw)</p>
  
  <p>MySQL table : info
  structure : 
  1. name
  2. class
  3. agree</p>
  
  <p>I want the php code to insert myname into <strong>name</strong> , selection's selected data into <strong>class</strong> , radio selected data into <strong>agree</strong></p>
  
  <p>P/S Yes i have added a connect to database php script , i just want to know how to get the form data into mysql.</p>
  
  <p>Can someone write a php code example on how can i do this?</p>
  
  <p>Thanks and have a nice day . I hope i have provided enough information. Thanks again if you help.</p>