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
Post a Comment