php - Syntax error or access violant 1064 -


i don't see problem in code, there solution in giving php access database?

<?php       try {          $db = new pdo('mysql:host=xxx;dbname=xxx', 'xxx', 'xxx');          $db->setattribute(pdo::attr_errmode, pdo::errmode_exception);      } catch (pdoexception $e) {          echo $e->getmessage();          die();      }            $query = $db->query('select * users');      $r = $query->fetch();      echo 'pre', print_r($r), '</pre>';  ?>

sqlstate[42000]: syntax error or access violation: 1064 have error in sql syntax; check manual corresponds mariadb server version right syntax use near '0' @ line 1 –


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -