title: How to fix mysql query syntax error
body: <p>I am learning some PHP/MYSQL over a tutorial and I think that syntax has changed since that tutorial was produced. Please help me out, this are my first steps with PHP/MYSQL. I have been stuck here for some hours now. Connection to DB is successful, but can't query any data.</p>
  
  <p>I run local wamp server and here is the code:
  PHP 5.4
  MYSQL 5.6</p>
  
  <p>Here is the error:</p>
  
  <blockquote>
    <p>You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table' at line 1</p>
  </blockquote>
  
  <pre><code>&lt;?php
  
  //error_reporting(E_ALL);
  require 'connect.php';
  $result = $db-&gt;query("SELECT * FROM table") or die($db-&gt;error);
  print_r($result);
  ?&gt;
  </code></pre>