<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 12 Feb 2012 21:49:02 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ariz Jacinto's Blog: Compiling PHP with MSSQL Server's Native ODBC Driver for Linux as a PDO Driver]]></title>
      <guid>http://www.phpdeveloper.org/news/17372</guid>
      <link>http://www.phpdeveloper.org/news/17372</link>
      <description><![CDATA[<p>
<i>Ariz Jacinto</i> has written up <a href="http://blog.acjacinto.com/2011/11/compiling-php-with-mssql-servers-native.html">a new post</a> with the commands you'll need to get PHP up and runnign with MSSQL Server's native ODBC driver working on linux (accessible through PDO).
</p>
<blockquote>
Last month, MS announced the preview release of <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/10/13/microsoft-announces-sql-server-odbc-driver-for-linux.aspx">SQL Server ODBC Driver for Linux</a>, a 64-bit binary driver for Red Hat Enterprise Linux 5. This is good news for companies using heterogenous platforms e.g. LAMP stack running a PHP application that connects to both MySQL and MSSQL Server. Meaning, these companies no longer have to use third-party drivers such as <a href="http://www.freetds.org/">FreeTDS</a> that MS doesn't support. Then a few days ago, MS <a href="http://www.microsoft.com/download/en/details.aspx?id=28160">released version 1 of the driver</a>. I immediately downloaded the driver and recompiled PHP with it as a PDO  (PHP Data Object) ODBC driver.
</blockquote>
<p>
His process has five steps to it, including one for making a test script (code included) and another with a few gotchas/performance considerations to keep an eye out for when using the driver.
</p>]]></description>
      <pubDate>Tue, 10 Jan 2012 12:34:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: The SQL Server ODBC Driver for Linux is Available!]]></title>
      <guid>http://www.phpdeveloper.org/news/17180</guid>
      <link>http://www.phpdeveloper.org/news/17180</link>
      <description><![CDATA[<p>
As <i>Brian Swan</i> has mentioned in <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/11/28/the-sql-server-odbc-driver-for-linux-is-available.aspx">his latest blog post</a>, the ODBC database driver for SQL Server on Linux has been released. This is a huge step forward for directly connecting linux-based systems (and programming languages) to this popular Microsoft product.
</p>
<blockquote>
The first beta release of the SQL Server ODBC Driver for Linux is available for download! As <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/10/13/microsoft-announces-sql-server-odbc-driver-for-linux.aspx">announced in October</a>, the "Multiplatform Team" (a.k.a. the "MPlat Team") has released a preview version of a driver that will provide first-class access to SQL Server from applications running on Linux operating systems. The team is looking for feedback on this release to incorporate into their production-ready release, so try it out and let us know what you think.
</blockquote>
<p>
He links to a few resources about the release - <a href="http://blogs.technet.com/b/dataplatforminsider/archive/2011/11/28/available-today-preview-release-of-the-sql-server-odbc-driver-for-linux.aspx">more details</a>, a <a href="http://www.microsoft.com/download/en/details.aspx?id=28160">link to download the driver</a> and the <a href="http://msdn.microsoft.com/en-us/library/hh568451(SQL.110).aspx">official documentation</a>.
</p>]]></description>
      <pubDate>Tue, 29 Nov 2011 08:39:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Version 3.0 (beta) of the SQL Server Drivers for PHP Released!]]></title>
      <guid>http://www.phpdeveloper.org/news/16925</guid>
      <link>http://www.phpdeveloper.org/news/16925</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has a new post to his MSDN blog today about the release of the latest version (3.0 beta) of the SQL Server drivers for PHP. <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/09/22/version-3-0-beta-of-the-sql-server-drivers-for-php-released.aspx">This new release</a> includes three improvements - buffered queries, support for LocalDB and support for high availability/disaster recovery.
</p>
<blockquote>
A <a href="http://blogs.msdn.com/b/sqlphp/archive/2010/06/14/what-is-a-community-technology-preview-ctp.aspx">Community Technology Preview</a> (a beta release) of v3.0 of the SQL Server Drivers for PHP was released today (see the announcement on the <a href="http://blogs.msdn.com/b/sqlphp/archive/2011/09/24/microsoft-drivers-3-0-for-php-for-sql-server-released.aspx">team blog</a>). You can download it here: <a href="http://www.microsoft.com/download/en/details.aspx?id=17308">Download v3.0 of the SQL Server Drivers for PHP</a>. [...] It's important to note that the latter two features are dependent on the next version of SQL Server (code named "Denali"). A preview of Denali can be downloaded for free here (see notes later in this article about the installation process): <a href="http://www.microsoft.com/sqlserver/en/us/future-editions.aspx">Download SQL Server Denali CTP 3</a>. 
</blockquote>
<p>
He gives brief summaries (some with example code) of what these three new features have to offer those using SQL Server in their applications. The "buffered queries" allows you to bring your entire result set into memory, making it simpler to interact with as rows/columns. The <a href="http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx">LocalDB</a> support gives developers a quick way to have a database without the hassle of a server - just connect right to the SQL Server database file. The high availability feature has been included for a while but has a new name in the upcoming release - <a href="http://blogs.technet.com/b/dataplatforminsider/archive/2011/08/18/alwayson-new-in-sql-server-code-name-quot-denali-quot-ctp3.aspx">SQL Server Always On</a>.
</p>]]></description>
      <pubDate>Thu, 29 Sep 2011 08:06:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: PHP Driver for SQL Server - Request for Feature Feedback]]></title>
      <guid>http://www.phpdeveloper.org/news/16596</guid>
      <link>http://www.phpdeveloper.org/news/16596</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> is <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/07/14/php-driver-for-sql-server-request-for-feature-feedback.aspx">asking for user feedback</a> about the future of the Microsoft's SQL Server driver for PHP based on <a href="http://blogs.msdn.com/b/sqlphp/archive/2011/07/14/feature-feedback.aspx">a post</a> in the team's blog.
</p>
<blockquote>
I want to make sure that his request gets in front of lots of eyes, so I'm re-posting his request here (below). Jonathan included some links in his post so you can learn more about what the team is considering for the next release of the driver, but he didn't elaborate on "Buffered Queries". 
</blockquote>
<p>
They <a href="http://blogs.msdn.com/b/sqlphp/archive/2011/07/14/feature-feedback.aspx">suggest</a> a few features and ask for choices on which would be the most important to you as a developer - Always On support, SQL Server Serverless Express support, Buffered queries and LOB streaming support in PDO_SQLSRV. To give feedback, send an email to the address mentioned <a href="http://blogs.msdn.com/b/sqlphp/archive/2011/07/14/feature-feedback.aspx">in the post</a> or on <a href="https://twitter.com/#%21/kop48">twitter</a>/<a href="http://social.msdn.microsoft.com/Forums/en-US/sqldriverforphp/">their forums</a>.
</p>]]></description>
      <pubDate>Fri, 15 Jul 2011 10:22:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: SQL Server Driver for PHP Connection Options: Encrypt & Failover_Partner]]></title>
      <guid>http://www.phpdeveloper.org/news/16030</guid>
      <link>http://www.phpdeveloper.org/news/16030</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has posted two more in his "SQL Server Driver for PHP" series looking at some of the connection options that are available. In these two new articles he looks at the <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/03/03/sql-server-driver-for-php-connection-options-failover-partner.aspx">Failover_Partner</a> and <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/03/08/sql-server-driver-for-php-connection-options-encrypt.aspx">Encrypt</a> options.
</p>
<blockquote>
<p>
Database mirroring is primarily a software solution for increasing database availability. [...] When a PHP application connects to the primary server, the Failover_Partner connection option specifies the name of the server to which the application should connect if the primary server is not available.
</p>
<p>
[...] These two options, Encrypt and TrustServerCertificate, are often used together. The Encrypt option is used to specify whether or not the connection to the server is encrypted (the default is false). The TrustServerCertificate option is used to indicate whether the certificate on the SQL Server instance should be trusted (the default is false).
</p>
</blockquote>
<p>
In both there's code examples showing the connection strings and what kinds of parameters you can pass to them. He also gives a few examples of scenarios when they might be useful.
</p>]]></description>
      <pubDate>Fri, 11 Mar 2011 08:41:11 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: SQL Server Driver for PHP Connection Options: ReturnDatesAsStrings]]></title>
      <guid>http://www.phpdeveloper.org/news/15876</guid>
      <link>http://www.phpdeveloper.org/news/15876</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has a new post to his blog today looking at one of the <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/02/08/sql-server-driver-for-php-connection-options-returndatesasstrings.aspx">connection options for the SQL Server driver</a> in PHP - the "ReturnDatesAsStrings" setting that can make handling date and time information simpler for PHP.
</p>
<blockquote>
This is short post to address a frustration I've seen mentioned on Twitter and in forums a lot: By default, the SQL Server Driver for PHP returns <a href="http://msdn.microsoft.com/en-us/library/ms187819.aspx">datetime</a> columns as <a href="http://www.php.net/manual/en/class.datetime.php">PHP DateTime</a> objects, not strings. This can be especially frustrating if you are not aware of the ReturnDatesAsStrings connection option. By simply setting this option to 1 (or true) when you connect to the server, datetime columns will be returned as strings.
</blockquote>
<p>
He includes some sample code showing how to use the setting (as a part of the settings array passed in to sqlsrv_connect) and the resulting array key from the fetched results on his sample table. This just gives you one more option for handling dates in your SQL Server-based application, especially if you don't need the full DateTIme object's functionality.
</p>]]></description>
      <pubDate>Wed, 09 Feb 2011 08:45:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Paging Data with the SQL Server Drivers for PHP: Simplified]]></title>
      <guid>http://www.phpdeveloper.org/news/15820</guid>
      <link>http://www.phpdeveloper.org/news/15820</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/01/26/paging-data-with-the-sql-server-drivers-for-php-simplified.aspx">simplified the pagination</a> using the SQL Server drivers for PHP in his latest post. He shows how to use a cursor to move around in the result set from your query.
</p>
<blockquote>
An oversimplified definition of a database cursor might be this: A cursor is database functionality that allows you to point to a certain location within a result set and allows you to move forward (and sometimes backward, depending upon the cursor type) through the result set one row at a time. [...] In the paging [scenario], I'll use a static cursor since that cursor type would seem to satisfy the requirements of many web-based applications.
</blockquote>
<p>
He shows how to execute a simple query with a dynamic cursor by specifying it in the connection call. He then uses the <a href="http://php.net/sqlsrv_num_rows">sqlsrv_num_rows</a> to find the number of records returned and a <a href="http://php.net/sqlsrv_fetch_array">sqlsrv_fetch_array</a> call to pull just the page you need. He also includes some handy code to paginate the results, complete with links.
</p>]]></description>
      <pubDate>Thu, 27 Jan 2011 12:54:56 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Using the Zend Framework and the PDO_SQLSRV Driver]]></title>
      <guid>http://www.phpdeveloper.org/news/15786</guid>
      <link>http://www.phpdeveloper.org/news/15786</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has a new tutorial posted to his MSDN blog today looking at how to use the <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/01/20/using-the-zend-framework-and-the-pdo-sqlsrv-driver.aspx">Zend Framework with the PDO_SQLSRV driver</a> to connect your applications to a SQL Server database.
</p>
<blockquote>
A couple of months ago, <a href="http://twitter.com/#!/akrabat">Rob Allen</a> pointed out <a href="http://akrabat.com/php/sqlsrv-v2-and-long-field-names/">in a blog post</a> that no Zend Framework PDO adapter existed for SQL Server. But, he also noted that it would be easy to write one...so he did: <a href="https://github.com/akrabat/Akrabat/blob/master/zf1/Akrabat/Db/Adapter/Pdo/Sqlsrv.php">https://github.com/akrabat/Akrabat/blob/master/zf1/Akrabat/Db/Adapter/Pdo/Sqlsrv.php</a>. Rob also mentioned that it would be very easy to use his adapter with the Zend Framework, but I wondered just how easy - that's what I'll investigate in this post. (Cut to the chase: it is very easy.)
</blockquote>
<p>
<i>Brian</i> takes the long way around for those that want the details. He talks about setting up Zend_Tool for Windows, setting up the <a href="http://akrabat.com/zend-framework-tutorial/">Zend Framework tutorial</a> and creating the application. This includes setting up the Apache rewrite rules (mod_rewrite), adding in the database information to your application.ini file and creating a basic table on the SQL Server database to connect to (based on SQL included with the tutorial).
</p>]]></description>
      <pubDate>Fri, 21 Jan 2011 12:52:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: How to Change Database Settings with the PDO_SQLSRV Driver]]></title>
      <guid>http://www.phpdeveloper.org/news/15562</guid>
      <link>http://www.phpdeveloper.org/news/15562</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has <a href="http://blogs.msdn.com/b/brian_swan/archive/2010/12/09/how-to-change-database-settings-with-the-pdo-sqlsrv-driver.aspx">a new post to his blog</a> about how you can change the database settings in your SQL Server database (with a connection using the PDO_SQLSRV driver) through a SQL query.
</p>
<blockquote>
The short story is this: If you are using the <a href="http://msdn.microsoft.com/en-us/library/ff628175(SQL.90).aspx">PDO_SQLSRV</a> driver and you want to execute a query that changes a database setting (e.g. <a href="http://msdn.microsoft.com/en-us/library/ms189837.aspx">SET NOCOUNT ON</a>), use the <a href="http://msdn.microsoft.com/en-us/library/ff628189(SQL.90).aspx">PDO::query</a> method with the <a href="http://msdn.microsoft.com/en-us/library/ff754356(SQL.90).aspx">PDO::SQLSRV_ATTR_DIRECT_QUERY</a> attribute. If you use PDO::query without that attribute, the database setting you expected to change may not be applied to subsequent queries. The longer story has to do with why this is the case, which is what I'll explain in this post.
</blockquote>
<p>
The problem is that, when changes to settings are made, they don't seem to stick. Future queries act like they were never even updated. The solution to the problem is to use that PDO::SQLSRV_ATTR_DIRECT_QUERY attribute on the connection (set to true). You can see the difference in execution from <a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-33-78-metablogapi/6175.image_5F00_750749DD.png">this</a> to <a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-33-78-metablogapi/0317.image_5F00_218053F7.png">this</a>.
</p>]]></description>
      <pubDate>Fri, 10 Dec 2010 09:38:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Why Pass Parameters by Reference in the SQLSRV Driver?]]></title>
      <guid>http://www.phpdeveloper.org/news/15491</guid>
      <link>http://www.phpdeveloper.org/news/15491</link>
      <description><![CDATA[<p>
<i>Brian Swaan</i> has <a href="http://blogs.msdn.com/b/brian_swan/archive/2010/11/23/why-pass-parameters-by-reference-in-the-sqlsrv-driver.aspx">a new post</a> to his blog talking about why you, in your SQL Server-based application, pass the parameters in by reference.
</p>
<blockquote>
Last week at <a href="http://jumpincamp.com/">JumpIn Camp</a> we spent quite a bit of time focusing on the <a href="http://sqlsrvphp.codeplex.com/">SQL Server Driver for PHP</a>. As developers worked to build SQL Server support into their applications, they had lots of questions about how both the <a href="http://msdn.microsoft.com/en-us/library/cc296152(SQL.90).aspx">SQLSRV</a> and <a href="http://msdn.microsoft.com/en-us/library/ff628175(SQL.90).aspx">PDO_SQLSRV</a> drivers work under the hood. One of the questions that came up was "When using the SQLSRV driver to execute parameterized queries, why do I have to pass parameters by reference?"
</blockquote>
<p>
He includes a simple code example to show this passing by reference - first without it on the call to sqlsrv_prepare (and the warning message it gives) then the more correct version of passing in the past parameter by reference. 
</p>
<blockquote>
The SQL Server Driver for PHP team understands that passing parameters by reference is not ideal. [...] With that said, the team is continuing to investigate solutions that would produce expected behavior without passing parameters by reference.
</blockquote>]]></description>
      <pubDate>Thu, 25 Nov 2010 09:15:22 -0600</pubDate>
    </item>
  </channel>
</rss>

