Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation PHP & PDO
<p>Last Week working all correctly but today i get this error:</p>

<blockquote>
  <p>Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''Mees'')' at line 1' in /www/data08/users/i/itsiim.planet.ee/htdocs/progemine/system/lisa.php:47 Stack trace: #0 /www/data08/users/i/itsiim.planet.ee/htdocs/progemine/system/lisa.php(47): PDOStatement->execute(Array) #1 {main} thrown in /www/data08/users/i/itsiim.planet.ee/htdocs/progemine/system/lisa.php on line 47</p>
</blockquote>

<p>PHP Code here</p>

<pre><code>    &lt;?php 
    require 'conf/db.php';
    if ( !empty($_POST)) {
        // keep track validation errors
        $nimiError = null;
        $emailError = null;
        $mobiilError = null;
        $suguError = null;

        // keep track post values
        $nimi = $_POST['nimi'];
        $email = $_POST['email'];
        $mobiil = $_POST['mobiil'];
        $sugu = $_POST['sugu'];

        // validate input
        $valid = true;
        if (empty($nimi)) {
            $nimiError = 'Palun sisesta nimi';
            $valid = false;
        }

        if (empty($email)) {
            $emailError = 'Palun sisesta e-mail';
            $valid = false;
        } else if ( !filter_var($email,FILTER_VALIDATE_EMAIL) ) {
            $emailError = 'Palun sisesta korrektne e-mail';
            $valid = false;
        }

        if (empty($mobiil)) {
            $mobiilError = 'Palun sisesta mobiili number';
            $valid = false;
        }

        if (empty($sugu)) {
            $suguError = 'Palun vali sugu';
            $valid = false;
        }

        // insert data
        if ($valid) {
            $pdo = Database::connect();
            $pdo-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
            $sql = "INSERT INTO kliendid (nimi,email,mobiil,sugu) values(?, ?, ?, ?')";
            $q = $pdo-&gt;prepare($sql);
            $q-&gt;execute(array($nimi,$email,$mobiil,$sugu));
            Database::disconnect();
            header("Location: index.php");
        }
    }
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang="et"&gt;
&lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Klientide andmed by Siim Aarmaa IS-13&lt;/title&gt;
    &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"&gt;
    &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;div class="container"&gt;

                &lt;div class="col-md-6 col-md-offset-3"&gt;
                    &lt;div class="row"&gt;
                        &lt;h3&gt;Lisa uus klient&lt;/h3&gt;
                    &lt;/div&gt;

                    &lt;form class="form-horizontal" action="lisa.php" method="post"&gt;
                      &lt;div class="form-group &lt;?php echo !empty($nimiError)?'error':'';?&gt;"&gt;
                        &lt;label class="col-sm-2 control-label"&gt;Nimi&lt;/label&gt;
                        &lt;div class="controls"&gt;
                            &lt;input name="nimi" type="text"  placeholder="Nimi" value="&lt;?php echo !empty($nimi)?$nimi:'';?&gt;"&gt;
                            &lt;?php if (!empty($nimiError)): ?&gt;
                                &lt;span class="help-block"&gt;&lt;?php echo $nimiError;?&gt;&lt;/span&gt;
                            &lt;?php endif; ?&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group &lt;?php echo !empty($emailError)?'error':'';?&gt;"&gt;
                        &lt;label class="col-sm-2 control-label"&gt;E-mail&lt;/label&gt;
                        &lt;div class="controls"&gt;
                            &lt;input name="email" type="text" placeholder="E-mail" value="&lt;?php echo !empty($email)?$email:'';?&gt;"&gt;
                            &lt;?php if (!empty($emailError)): ?&gt;
                                &lt;span class="help-block"&gt;&lt;?php echo $emailError;?&gt;&lt;/span&gt;
                            &lt;?php endif;?&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group &lt;?php echo !empty($mobiilError)?'error':'';?&gt;"&gt;
                        &lt;label class="col-sm-2 control-label"&gt;Mobiili number&lt;/label&gt;
                        &lt;div class="controls"&gt;
                            &lt;input name="mobiil" type="text"  placeholder="Mobiili number" value="&lt;?php echo !empty($mobiil)?$mobiil:'';?&gt;"&gt;
                            &lt;?php if (!empty($mobiilError)): ?&gt;
                                &lt;span class="help-block"&gt;&lt;?php echo $mobiilError;?&gt;&lt;/span&gt;
                            &lt;?php endif;?&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class="form-group &lt;?php echo !empty($suguError)?'error':'';?&gt;"&gt;
                        &lt;label class="col-sm-2 control-label"&gt;Sugu&lt;/label&gt;
                        &lt;div class="controls"&gt;
                            &lt;input name="sugu" type="radio" value="&lt;?php echo !empty($mees)?$mees:'Mees';?&gt;"&gt;Mees
                            &lt;input name="sugu" type="radio" value="&lt;?php echo !empty($naine)?$naine:'Naine';?&gt;"&gt;Naine
                            &lt;?php if (!empty($suguError)): ?&gt;
                                &lt;span class="help-block"&gt;&lt;?php echo $suguError;?&gt;&lt;/span&gt;
                            &lt;?php endif;?&gt;
                        &lt;/div&gt;
                      &lt;div class="form-group"&gt;
                          &lt;button type="submit" class="btn btn-success"&gt;Lisa klient&lt;/button&gt;
                          &lt;a class="btn btn-default" href="index.php"&gt;Tagasi&lt;/a&gt;
                        &lt;/div&gt;
                    &lt;/form&gt;
                &lt;/div&gt;
    &lt;/div&gt; &lt;!-- /container --&gt;
  &lt;/body&gt;
&lt;/html&gt;`enter code here`
</code></pre>