title: SQLSTATE[42000]: Syntax error or access violation: 1064 Error
body: <p>I am getting the following error on a website. I create ticket for this reason in my hosting provider. It told me &quot;<em>You need to edit the select query, not a select query suitable for the mariadb version on the server.</em>&quot; they said.</p>
  <p><strong>error_log File:</strong></p>
  <pre><code> [25-Dec-2021 19:50:24 Europe] PHP Fatal error:  Uncaught PDOException: 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 'and dripfeed= 2' at line 1 in /home/user/public_html/script.php:461
          Stack trace:
          #0 /home/user/public_html/script.php(461): PDO-&gt;query('SELECT * FROM o...')
          #1 /home/user/public_html/index.php(35): require_once('/home/user/...')
          #2 {main}
            thrown in /home/user/public_html/script.php on line 461
  </code></pre>
  <p><strong>script.php File:</strong></p>
  <pre><code>$dripfeedvarmi = $conn-&gt;query(&quot;SELECT * FROM demo WHERE user=$user_id and dripfeed=2&quot;);
          if ($dripfeedvarmi-&gt;rowCount())
          {
              $dripfeedcount = 1;
          }
          else
          {
              $dripfeedcount = 0;
          }
  </code></pre>
  <p><strong>Current DB Version:</strong> 10.2.41-MariaDB-cll-lve <br>
  <strong>PHP Version:</strong> 7.4.25 <br>
  <strong>OS:</strong> Linux
  <br>
  <br>
  Thank you in advance for your help.</p>