<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Connecting to SQL Server in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/connecting-to-sql-server/m-p/467177#M3133</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a database in SQL Server platform in ArcGIS desktop. I am trying to connect to this database using PHP_PDO_SQLSRV. When I try this, I get a fatal error. The codes used to connect to the database:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$serverName &lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'SERVERNAME'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$connectionInfo&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'Database'&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'DATABASE'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'UID'&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'USERNAME'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'PWD' &lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'PASSWORD'&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$conn&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=sqlsrv_connect(&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$serverName&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$connectionInfo&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$conn&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;){
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;echo &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;"Connection to SQL Server is successful! &amp;lt;/br&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;echo &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;"Connection failed! &amp;lt;/br&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;die&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;(print_r(sqlsrv_errors()&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;TRUE&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;))&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: medium;"&gt;Fatal error&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-size: medium;"&gt;: Call to undefined function sqlsrv_connect() in the line $conn=sqlsrv_connect();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: medium;"&gt;Could anyone please help me with this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: medium;"&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:43:54 GMT</pubDate>
    <dc:creator>SarojThapa1</dc:creator>
    <dc:date>2021-12-11T20:43:54Z</dc:date>
    <item>
      <title>Connecting to SQL Server</title>
      <link>https://community.esri.com/t5/developers-questions/connecting-to-sql-server/m-p/467177#M3133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a database in SQL Server platform in ArcGIS desktop. I am trying to connect to this database using PHP_PDO_SQLSRV. When I try this, I get a fatal error. The codes used to connect to the database:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$serverName &lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'SERVERNAME'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$connectionInfo&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'Database'&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'DATABASE'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'UID'&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'USERNAME'&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'PWD' &lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;'PASSWORD'&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;
&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$conn&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;=sqlsrv_connect(&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$serverName&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$connectionInfo&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #9876aa; background-color: #232525;"&gt;$conn&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;){
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;echo &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;"Connection to SQL Server is successful! &amp;lt;/br&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;else&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;echo &lt;/SPAN&gt;&lt;SPAN style="color: #6a8759; background-color: #232525;"&gt;"Connection failed! &amp;lt;/br&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;die&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;(print_r(sqlsrv_errors()&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525; font-weight: bold;"&gt;TRUE&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;))&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; background-color: #232525;"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="background-color: #232525;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I get the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000000; font-size: medium;"&gt;Fatal error&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-size: medium;"&gt;: Call to undefined function sqlsrv_connect() in the line $conn=sqlsrv_connect();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: medium;"&gt;Could anyone please help me with this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: medium;"&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:43:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/connecting-to-sql-server/m-p/467177#M3133</guid>
      <dc:creator>SarojThapa1</dc:creator>
      <dc:date>2021-12-11T20:43:54Z</dc:date>
    </item>
  </channel>
</rss>

