title: PHP POST requests only inserts blank rows
body: <p>So i'm pretty new to PHP and can't understand why my POST request is not working. .</p>
  <p>I'm just building a simple TodoApp and have a Add new task view like this:
  add.php</p>
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;html lang=&quot;en&quot;&gt;
      
      &lt;head&gt;
          &lt;meta charset=&quot;UTF-8&quot; /&gt;
          &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;
          &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;ie=edge&quot; /&gt;
          &lt;link href=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css&quot; rel=&quot;stylesheet&quot; /&gt;
      
          &lt;link rel=&quot;stylesheet&quot; href=&quot;../css/style.css&quot; /&gt;
      
          &lt;title&gt;To-Do List&lt;/title&gt;
      &lt;/head&gt;
      
      &lt;body&gt;
          &lt;div class=&quot;wrapper&quot;&gt;
      
              &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
                  &lt;h2 class=&quot;title&quot;&gt;Add a new task&lt;/h2&gt;
      
                  &lt;div class=&quot;content&quot;&gt;
                      &lt;div class=&quot;inputFields&quot;&gt;
      
                          &lt;label for=&quot;task&quot;&gt;Task:&lt;/label&gt;
                          &lt;input type=&quot;text&quot; name=&quot;task&quot; placeholder=&quot;Task name&quot; /&gt;
      
                          &lt;label for=&quot;task&quot;&gt;Description:&lt;/label&gt;
                          &lt;br /&gt;
                          &lt;textarea type=&quot;text&quot; name=&quot;description&quot; placeholder=&quot;Add a description&quot;  rows=&quot;5&quot;
                              cols=&quot;40&quot;&gt;&lt;/textarea&gt;
                          &lt;br /&gt;
      
                          &lt;button type=&quot;submit&quot; class=&quot;btn&quot;&gt;Save&lt;/button&gt;
      
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/form&gt;
      
              &lt;a href=&quot;../index.php&quot;&gt;&lt;button class=&quot;btn&quot;&gt;Go back&lt;/button&gt;&lt;/a&gt;
          &lt;/div&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  <p>My db file DB.php looks like this:</p>
  <pre><code>&lt;?php
  
  error_reporting (E_ALL ^ E_NOTICE);  
  
  /**
   * @package DBConnection
   * @author Frida
   */
  
  // DB Connection
  $pdo = new PDO('mysql:host=localhost;port=3306;dbname=TodoApp', 'root', '');
  $pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  
  // GET - Get All tasks
  $statement = $pdo-&gt;prepare('SELECT * FROM todo_list ORDER BY created DESC');
  $statement-&gt;execute();
  // Fetch all tasks as an assoc array
  $tasks = $statement-&gt;fetchAll(PDO::FETCH_ASSOC); 
  
   // POST - Add a task
  
  $task = $_POST['task'];
  $description = $_POST['description'];
  $date = date('Y-m-d H:i:s');
  
  $pdo-&gt;exec(&quot;INSERT INTO todo_list (task, description, status, created)
  VALUES ('$task', '$description', 0, '$date')
  &quot;) 
  
  ?&gt;
  </code></pre>
  <p>This is my schema:
  <a href="https://i.stack.imgur.com/kX7Cq.png" rel="nofollow noreferrer">Todo schema</a></p>
  <p>I've done var_dump($_POST) which shows the array without any issues, if anyone can help me out?</p>