title: How to connect php webservice to sql server 2008 r2
body: <p>We are developing php webservice and our database is on sql server 2008 r2 </p>
  
  <p>/* sql connection string  */</p>
  
  <pre><code>     $link = mssql_connect('localhost','usrname','pass') or die('Cannot connect to the DB');     
       mssql_select_db('Data Source=PC-NAME;Initial Catalog=DBNAME.MDF;Persist Security Info=True',$link) or die('Cannot select the DB');
  
          /* grab the posts from the db */
  
          echo $query = "SELECT * FROM add_product WHERE prod_pos = '".$_GET['prod_pos']."'";
          $result = mssql_query($query,$link) or die('Errant query:  '.$query);
  </code></pre>
  
  <p>it gives fatal error on mssql_connect.</p>
  
  <p>Fatal error: Call to undefined function mssql_connect() in service.php on line 11</p>
  
  <p>So how to connect php webservice with sql server 2008 r2???</p>
  
  <p>Thanks in advance... </p>