Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 PhpStorm 中编写查询时,我收到警告“未配置 SQL 方言”。我正在使用 MySQL 数据库
$query = "SELECT * FROM anvandare WHERE anvandarnamn = '$this->username' AND losenord ='$this->'password'";
如何将方言配置为 MySQL?
试试这个:
$query = "SELECT * FROM anvandare WHERE anvandarnamn = '" . $this->username . "' AND losenord ='" . $this->password . "'";
更新 - 2017 年 2 月
永远不要以这种方式编写查询(让用户输入作为查询的一部分运行)。如果您不是非常谨慎(有时这还不够),您将受到 SQL 注入的影响。如果您以这种方式编写查询,您应该阅读更多关于prepared statements的内容。