Intellisense not working properly in Visual Studio Code with MYSQL

10,305

My most preferred extensions for PHP development in Visual Studio Code,

  1. PHP Intelephense (Provides faster intellisense), Visual Studio Marketplace
  2. PHP CS Fixer (Formats PHP source files, including html files), Visual Studio Market Place
  3. After installing these two extensions, go to visual studio code settings, and add below lines "php.suggest.basic": false, "php-cs-fixer.formatHtml": true,

    • As a side note, to enable php-cs-fixer format html embedded in php files, download this file and add the below settings to your visual studio code settings.
    • Php-cs-fixer.phar from Github link

    "php-cs-fixer.executablePath": "/path/to/php-cs-fixer.phar"

Share:
10,305
ehh
Author by

ehh

Updated on August 03, 2022

Comments

  • ehh
    ehh almost 2 years

    I am very new on PHP and Visual Studio Code. I have installed all needed to start developing a basic website. I have installed different extensions in VS Code but no one provide intellisense for operations such as

    mysqli_query, mysqli_fetch_array ...

    In the other hand, it recognize:

    mysql_query, mysql_fetch_array

    I have installed:

    • PHP intellisense
    • PHP debug
    • PHP extension pack

    What should be done in order to have MYSQL intellisense work properly?

  • g4ost
    g4ost almost 5 years
    Worked for me for mysqli_query but if you try to use something like example $conn_K->query() it will not find that way of doing it. Either way very helpful thanks.
  • TechNyquist
    TechNyquist about 4 years
    Didn't know builtin PHP autocomplete was so basic. Builtin returns complete PHP dictionary of functions, superglobals and in-scope variables and types as object suggestions, context insensitive; disabling it with php.suggest.basic: false (and using Intelephense) made it more useful. Thanks.