title: PHP Webservice with PDO
body: <p>I want to retreive some data from my mssql data base using the following code : </p>
  
  <pre><code>public function areaGetCities($json){
          $request = json_decode($json);
          $response = '';
          $response-&gt;list = array();
  
          if (!empty($request-&gt;language_id) &amp;&amp;
              !empty($request-&gt;country_id) &amp;&amp;
              !empty($request-&gt;postal_code)){
              $this-&gt;db_stmt = new PDOStatement();
              $this-&gt;db_stmt = $this-&gt;db-&gt;prepare('EXECUTE areaGetCities :language_id, :country_id, :postal_code');
              $this-&gt;db_stmt-&gt;bindParam(':language_id', $request-&gt;language_id, PDO::PARAM_INT);
              $this-&gt;db_stmt-&gt;bindParam(':country_id', $request-&gt;country_id, PDO::PARAM_INT);
              $this-&gt;db_stmt-&gt;bindParam(':postal_code', $request-&gt;postal_code, PDO::PARAM_STR, 40);
              $this-&gt;db_stmt-&gt;execute();
              while ($obj = $this-&gt;db_stmt-&gt;fetchObject()){
                  $response-&gt;list[] = $obj;
                  unset($obj);
              }             
          }        
          return json_encode($response);         
      }
  </code></pre>
  
  <p>if i print errorInfo() i get </p>
  
  <blockquote>
    <p>Tried to bind parameter number 0.  SQL Server supports a maximum of 2100 parameters.
    IMSSP
    -29</p>
  </blockquote>
  
  <p>my problem is that i don't get any result from my database and i have to get (i ran the procedure with the same parameters and i get 2 result).</p>
  
  <p>ideas ?</p>
  
  <p>Edit : I edited my code. Now i get :</p>
  
  <blockquote>
    <p>[Microsoft][SQL Server Native Client 11.0][SQL Server]The formal parameter "@postal_code" >was not declared as an OUTPUT parameter, but the actual parameter passed in requested >output.</p>
  </blockquote>
  
  <pre><code>CREATE PROCEDURE areaGetCities(@language_id TINYINT, @country_id INT, @postal_code VARCHAR(40))
  </code></pre>