how do i avoid those fake errors of added extensions like : undefined function sqlsrv_connect ?
@bmewburn this's confirmed. @logicalusers the normal php autocomplete from vs also doesn't recoqnize this function. I think as for now, everyone move towards PDO, and if it's not a legacy code, please stop using functional based code for connecting to DB, especially if you get input from the user, it's not safe enough as the PDO ways of query data.
@bmewburn
https://www.php.net/manual/en/ref.sqlsrv.php
How to add this all function to this project? Or it's part of the propiertary license on https://github.com/bmewburn/intelephense-docs#licence ? I'm glad to help a hand if It's possible to help.
@logicalusers Please add sqlsrv to intelephense.stubs setting in vscode.
I think as for now, everyone move towards PDO, and if it's not a legacy code, please stop using functional based code for connecting to DB, especially if you get input from the user, it's not safe enough as the PDO ways of query data.
@benyaminl Sorry, but it's not true. First of all, both are still officially supported and regularly updated. Okay, Object oriented programming is better in some way, but it's not end of the world to use procedural style. Also You need to remember that PDO provides unification layer which may prevent you from doing some DB-specific operations.
About data from users: what you probably mean is Prepared statements which are also available in sqlsrv, but even with them you need to validate input data - always.
Function reference is provided from this repository: https://github.com/JetBrains/phpstorm-stubs
And since this is microsoft's extension better documentation is here: https://docs.microsoft.com/en-us/sql/connect/php/sqlsrv-driver-api-reference?view=sql-server-ver15
@KapitanOczywisty is correct sqlsrv is not enabled by default. Please add it to your intelephense.stubs setting.
@logicalusers Please add
sqlsrvtointelephense.stubssetting in vscode.I think as for now, everyone move towards PDO, and if it's not a legacy code, please stop using functional based code for connecting to DB, especially if you get input from the user, it's not safe enough as the PDO ways of query data.
@benyaminl Sorry, but it's not true. First of all, both are still officially supported and regularly updated. Okay, Object oriented programming is better in some way, but it's not end of the world to use procedural style. Also You need to remember that PDO provides unification layer which may prevent you from doing some DB-specific operations.
About data from users: what you probably mean is
Prepared statementswhich are also available in sqlsrv, but even with them you need to validate input data - always.Function reference is provided from this repository: https://github.com/JetBrains/phpstorm-stubs
And since this is microsoft's extension better documentation is here: https://docs.microsoft.com/en-us/sql/connect/php/sqlsrv-driver-api-reference?view=sql-server-ver15
Whoa. Ok. I never know that it support the jet rains stubs and I never know jetbrain stubs is used for adding auto complete files for intelephense.
Until today I never lack any ability that PDO can't do and maybe I'm hating the prosedural ways of writing yea so it's wrong and bias. But in many ways as far as I know, many people done the prepared statement wrong ways in prosedural function, and I also one of it, so I move away from it, and forgot it for very long time.
hey guys about pdo i know it , for what i want to do sqlsrv will be faster no need pdo because its not a a public project. i will look at intelephense.stubs set to see if i can add it thanks for the help.
Most helpful comment
@logicalusers Please add
sqlsrvtointelephense.stubssetting in vscode.@benyaminl Sorry, but it's not true. First of all, both are still officially supported and regularly updated. Okay, Object oriented programming is better in some way, but it's not end of the world to use procedural style. Also You need to remember that PDO provides unification layer which may prevent you from doing some DB-specific operations.
About data from users: what you probably mean is
Prepared statementswhich are also available in sqlsrv, but even with them you need to validate input data - always.Function reference is provided from this repository: https://github.com/JetBrains/phpstorm-stubs
And since this is microsoft's extension better documentation is here: https://docs.microsoft.com/en-us/sql/connect/php/sqlsrv-driver-api-reference?view=sql-server-ver15