title: Survey in Mysql
body: <p>I really need some help with this survey. I want to insert it into phpmyadmin. I'm studying and i need this for a project. </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;link rel="stylesheet" href="style.css" type="text/css"/&gt;
      &lt;script src="https://code.jquery.com/jquery-2.1.4.min.js"&gt;&lt;/script&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
  &lt;form action="action.php" method="get"&gt;
      &lt;h1&gt;KÆLEDYR&lt;/h1&gt;
      &lt;h3&gt;Oplysninger om dig&lt;/h3&gt;
      Navn:&lt;br&gt;
      &lt;input type="text" name="name" value="Navn"&gt;&lt;br&gt;&lt;br&gt;
      Email:&lt;br&gt;
      &lt;input type="email" name="email" value="navn@gmail.com"&gt;&lt;br&gt;&lt;br&gt;
      Køn:&lt;br&gt;
      &lt;input type="radio" name="gender" value="male" checked&gt; Mand&lt;br&gt;
      &lt;input type="radio" name="gender" value="female"&gt; Kvinde&lt;br&gt;
      &lt;input type="radio" name="gender" value="other"&gt; Ved ikke&lt;br&gt;&lt;br&gt;
      Alder:
      &lt;input type="number" name="age" value="ex.20"&gt;&lt;br&gt;&lt;br&gt;
  
      &lt;h3&gt;Har du kæledyr?&lt;/h3&gt;
      Har du kæledyr?:&lt;br&gt;
      &lt;input type="radio" name="yes" value="yes" checked&gt;Ja&lt;br&gt;
      &lt;input type="radio" name="no" value="no"&gt;Nej&lt;br&gt;&lt;br&gt;
  
      Hvis ja, hvor mange har du?:
      &lt;input type="number" name="pet-number" value="ex.20"&gt;&lt;br&gt;&lt;br&gt;
  
      Hvilke kældedyr har du?:
      &lt;br&gt;
      &lt;input type="checkbox" name="animal1" value="Hund"&gt;Hund
      &lt;br&gt;
      &lt;input type="checkbox" name="animal2" value="Kat"&gt;Kat
      &lt;br&gt;
      &lt;input type="checkbox" name="animal3" value="Reptil"&gt;Reptil
      &lt;br&gt;
      &lt;input type="checkbox" name="animal4" value="Fugl"&gt;Fugl
      &lt;br&gt;
      &lt;input type="checkbox" name="animal5" value="Fisk"&gt;Fisk
      &lt;br&gt;
      &lt;input type="checkbox" name="animal6" value="Hest"&gt;Hest
      &lt;br&gt;
      &lt;input type="checkbox" name="animal6" value="andet"&gt;Andet  
      &lt;br&gt;&lt;br&gt;
  
      Kældedyrs quiz: 
      &lt;br&gt;
      En dalmatiner er stribet?:
      &lt;br&gt;
      &lt;input type="radio" name="true" value="true" checked&gt;Sandt&lt;br&gt;
      &lt;input type="radio" name="false" value="false"&gt;Falsk&lt;br&gt;&lt;br&gt;
      &lt;br&gt;
      En hest har 5 ben:
      &lt;br&gt;
      &lt;input type="radio" name="true" value="true" checked&gt;Sandt&lt;br&gt;
      &lt;input type="radio" name="false" value="false"&gt;Falsk&lt;br&gt;&lt;br&gt;
  
      &lt;input type="submit"&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My action.php looks like this.</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;?php
  /*
  File: action.php
  Purpose: INSERT INTO ...
  */
  
  $mysqli = new mysqli("localhost", "root", "","survey"); // creates the object
  if ($mysqli-&gt;connect_errno) {
      echo "Failed to connect to MySQL: (" . $mysqli-&gt;connect_errno . ") " . $mysqli-&gt;connect_error; // if error messages
  }
  
  echo "You're connected to the database via: " 
  . $mysqli-&gt;host_info 
  . "\n";
  
  
  
      if($_GET) { 
      /*          
          $fn = $_GET['firstName'];
          $ln = $_GET['lastName'];    
  
          // format the sql
          $sql = "INSERT INTO `sakila`.`actor` (`actor_id`, `first_name`, `last_name`, `last_update`) VALUES (NULL, '" 
          . $fn 
          . "', '" 
          . $ln 
          . "', CURRENT_TIMESTAMP);";
          */          
          // INSERT
          $sql = "INSERT INTO `person` (`name`, '".$_GET['name']."')";
          echo $_GET["name"];
  
  
          $insert = $mysqli-&gt;query($sql); 
  
          echo "&lt;p&gt;et svar her ....&lt;/p&gt;";
          echo $sql;
  
      }
      else {
          echo "&lt;p&gt;Error: Use the form please. No GET got.&lt;/p&gt;";
      }
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How do i proceed and get my survey into the database?</p>