Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellisense not working properly in Visual Studio Code with MYSQL

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?

like image 474
ehh Avatar asked Feb 05 '23 10:02

ehh


1 Answers

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"

like image 66
Danny Sofftie Avatar answered Feb 08 '23 05:02

Danny Sofftie