I wanted to write a PHP script in which i had to execute INSERT query in MySQL database using prepared statement.
As i am a beginner in PHP, i had no idea how to do it. so I looked it up on Stackoverflow and found this How to create a secure mysql prepared statement in php?
.
So i started doing it in same way as done in the accepted answer BUT in the answer, there are some methods used, like
prepareto prepare theSELECTquerybind_paramto bind parameters to querycloseto close to$stmt
which are not suggested to me by Visual Studio Code when i try to use them. Also when i use these methods and hover the pointer over them, no documentation is shown by the Visual Studio Code which made me think whether these methods are available anymore or not.
Instead of prepare method, Visual Studio Code suggests odbc_prepare, instead of bind_param, it suggests mysqli_bind_param and instead of close, it suggests odbc_close.
I am using PHP 7.2
Question: Are methods like prepare, close, bind_param not available in PHP 7 and can i use the ones suggested to me by Visual Studio Code in place of these methods ?