Fatal Error with PhP on submit
<p>I'm making a form where I can add records to a database through the browser. When I press submit, it comes up with this error</p>

<blockquote>
  <p>Fatal error: Call to a member function execute() on boolean in
  /srv/http/career.php on line 56</p>
</blockquote>

<p>Line 56 is based of this PhP line:</p>

<pre><code>$result-&gt;execute($_POST);
</code></pre>

<p>It's not related to the connection of the database, that works because I am able to view already made records.</p>

<p>Full code</p>

<p>HTML</p>

<pre><code>&lt;form method="POST"&gt;
    &lt;label for="jobtitle"&gt;Job Title&lt;/label&gt; &lt;input type="text" name="jobtitle" /&gt; &lt;br&gt;
    &lt;label for="reference"&gt;Reference&lt;/label&gt; &lt;input type="text" name="reference" /&gt; &lt;br&gt;
    &lt;label for="salary"&gt;Salary&lt;/label&gt; &lt;input type="text" name="salary"/&gt; &lt;br&gt;
    &lt;label for="location"&gt;Location&lt;/label&gt; &lt;input type="text" name="location"/&gt; &lt;br&gt; &lt;br&gt;
    &lt;label for="description"&gt;Description&lt;/label&gt; &lt;input type="text" name="description"/&gt; &lt;br&gt; &lt;br&gt;
    &lt;input type="submit" value="submit" name="submit"/&gt;
&lt;/form&gt;
</code></pre>

<p>PhP</p>

<pre><code>&lt;?php
if(isset($_POST['jobtitle'],$_POST['reference'],$_POST['salary'],$_POST['location'],$_POST['description'])){
    $result= $pdo-&gt;query('INSERT INTO jobs (job_title, job_ref, job_salary, job_location, job_desc)
        VALUES ("' . $_POST['jobtitle'] . '","' . $_POST['reference'] . '","' . $_POST['location'] . '","' . $_POST['description'] .'")');
        unset($_POST['submit']); 

    $result-&gt;execute($_POST);
}
?&gt;
</code></pre>

<p>Any help is appreciated </p>