title: PHP SQL Server, call a stored procedures with parameters
body: <p>i'm facing this next problem: </p>
  
  <p>i made a stored procedure as follow:</p>
  
  <pre><code>CREATE PROCEDURE verify_user_connection
  @username nvarchar(50),
  @pass nvarchar(50)
  AS
  
  BEGIN
  
  SELECT users.username, users.pass 
  FROM dbo.users
  WHERE users.username = '@username'
  AND users.pass = '@pass'
  
  RETURN '@username'
  
  END
  </code></pre>
  
  <p>and from the PHP code i call him like this:</p>
  
  <pre><code>  &lt;?php
    /* Handle form buttons. */
    if (isset($_POST['login'])) {
      if (!empty($_POST['username']) || !empty($_POST['pass'])) {
        $username = $_POST['username'];
        $password = $_POST['pass'];
        $sql = "{ CALL dbo.verify_user_connection (@username = ?, @pass = ?) }";
        $param = array($username, $password);
        $result = sqlsrv_query($conn, $sql, $param);
        $row = sqlsrv_fetch_object($result);
        echo $row;
        if (!$row) {
          die(print_r(sqlsrv_errors()));
        }
        else {
          echo "record found";
        }
      }
      else {
        echo "something went wrong";
      }
    }
    ?&gt;
  </code></pre>
  
  <p>well i'm kinda new in SQLSRV driver of microsoft and i know my syntax is not accurate here
  could someone inlight my problem and explain to me what am i doing wrong?? </p>
  
  <p>thanks in advance</p>