How to execute a stored procedure in php using sqlsrv and “?” style parameters
问题 I've looked over several other questions that seem (from the titles) the same as this. However, my case is a bit different. The following works (i.e. I get "success" and my database performs what I expect when running the procedure with the given variables): $sql = "MyDB.dbo.myProcedure {$var1}, {$var2}, {$var3}"; $result = sqlsrv_query($myConn, $sql); if (!$result) { echo 'Your code is fail.'; } else { echo 'Success!'; } I want to avoid (or lessen the possibility of) SQL injection by