Search code examples
phpmysqlconfigphpstormdialect

SQL dialect is not configured Phpstorm


I'm getting getting warning "SQL dialect is not configured" when I write queries in PhpStorm. I'm using MySQL database

$query = "SELECT * FROM anvandare WHERE anvandarnamn = '$this->username' AND losenord ='$this->'password'";

How do I configure the dialect to MySQL?


Solution

  • Try this instead:

    $query = "SELECT * FROM anvandare WHERE anvandarnamn = '" . $this->username . "' AND losenord ='" . $this->password . "'";
    

    UPDATE - FEB 2017

    Never ever write a query this way (letting user input run as part of the query). If you're not being extremely cautious (sometimes that's not even enough), you're going to be subject to an SQL injection. If you're writing queries this way you should read more about prepared statements.