title: SQL server PHP PDO COUNT field incorrect or syntax error
body: <p>I didn't want to post this but last resort.</p>
  
  <p>PHP with MS SQL Server 2008 and I'm getting an error of: [SQLSTATE[07002]: [Microsoft][ODBC Driver 11 for SQL Server]COUNT field incorrect or syntax error
  Here is my code: </p>
  
  <pre><code>    $server_name = 'sqlserver';
      $user = 'user';   
      $passwd = 'pass';
  
      $sqlString = "INSERT INTO dbo.tbl (UniqID, rideid, stopRatingId, category, ddescription, rating, createdDate) VALUES (?, ?, ?, ?, ?, ?, ?)";
  
      $conn = new PDO("sqlsrv:Server=$server_name;Database=db;ConnectionPooling=0", $user, $passwd);
      $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $stmt = $conn-&gt;prepare($sqlString);
  
      $sqlVals = "'1', '233', '34', 'Delivery', 'Data Integrity', 'Good', '2018-07-11 08:34:21'";
      $stmt-&gt;execute(array($sqlVals));
  </code></pre>
  
  <p>The array shows:</p>
  
  <pre><code>print_r(array($sqlVals));
  
  Array ( [0] =&gt; '1', '233', '34', 'Delivery', 'Data Integrity', 'Good', '2018-07-11 08:34:21' ) 
  </code></pre>
  
  <p>when I try this, the insert is successful without error:</p>
  
  <pre><code>$stmt-&gt;execute(array('1', '233', '34', 'Delivery', 'Data Integrity', 'Good', '2018-07-11 08:34:21'));
  </code></pre>
  
  <p>Not sure how to correct - any help is much appreciated!</p>