title: Storing form input in phpMyAdmin database with PHP
body: <p>I'm trying to learn how to use databases in PHP.</p>
  
  <p>My main html file creates somewhat like a login form. The data which was used as input there is redirected to the PHP file, where it should be printed and also stored in the database.</p>
  
  <pre><code>&lt;?php error_reporting(E_ALL);
  
          function db_con($data_array){
              $db = mysqli_connect("localhost", "root", "", "form") or die("Fehler beim Herstellen der Verbindung zur Datenbank!");
              mysqli_set_charset($db, 'utf8');
  
              mysqli_query($db, "
                  INSERT INTO 'data'
                  (
                      'E-Mail', 'Name', 'Bewertung', 'Kommentar', 'Thema'
                  )
                  VALUES
                  (
                      '".$data_array['E-Mail']."',
                      '".$data_array['Name']."',
                      '".$data_array['Buchbewertung']."',
                      '".$data_array['Kommentar']."',
                      '".$data_array['Lieblingsthema']."'
                  )
              ") or die("Fehler beim Schreiben der Datensätze!");
          }
  
              if(isset($_POST['name'], $_POST['email'], $_POST['rating'], $_POST['comment'], $_POST['interest'])){
              $data_array = array(
                      "Name" =&gt; $_POST['name'],
                      "E-Mail" =&gt; $_POST['email'],
                      "Buchbewertung" =&gt; $_POST['rating'],
                      "Kommentar" =&gt; $_POST['comment'],
                      "Lieblingsthema" =&gt; $_POST['interest']
                  );
  
              echo "&lt;th colspan='2'&gt;Folgende Daten wurden übermittelt: &lt;/th&gt;";
              echo "&lt;br&gt;&lt;br&gt;";
  
                  foreach($data_array as $key =&gt; $val){
                      echo "&lt;tr&gt;&lt;td&gt;&lt;b&gt;". $key. ": ". "&lt;/b&gt;&lt;/td&gt;&lt;td&gt;". $val. "&lt;/td&gt;&lt;/tr&gt;";
                  }
  
                  db_con($data_array);
              }
          ?&gt;
  </code></pre>
  
  <p>I don't get why it doesn't work. There is no error, but the script stops after mysqli_query (last output: Fehler beim Schreiben der Datensätze!).</p>
  
  <p>Can someone help me why all those data sets won't be stored in the database and how to fix it?</p>