<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Microsoft SQL Server Driver for PHP Team Blog : Row count</title><link>http://blogs.msdn.com/sqlphp/archive/tags/Row+count/default.aspx</link><description>Tags: Row count</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Working on version 1.1 of the SQL Server Driver for PHP</title><link>http://blogs.msdn.com/sqlphp/archive/2009/02/18/Working-on-version-1.1-of-the-SQL-Server-Driver-for-PHP.aspx</link><pubDate>Wed, 18 Feb 2009 19:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9426834</guid><dc:creator>sqlphp</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/sqlphp/comments/9426834.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlphp/commentrss.aspx?PostID=9426834</wfw:commentRss><description>&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: black"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;The SQL Server Driver for PHP team is hard at work on the version 1.1 of the extension.&amp;nbsp; We've received a lot of feedback for feature requests from PHP developers through the blog, forums, the Seattle PHP meetup group, and various conferences.&amp;nbsp; The most frequent feature requests have been in the following areas:&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'"&gt;Support for PHP 5.3&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black; mso-fareast-font-family: 'Times New Roman'"&gt;Support for handling UTF-8 strings in parameters and resultset values, without requiring calls to iconv or other extensions&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; COLOR: black; mso-list: l0 level1 lfo1; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 12pt; mso-fareast-font-family: 'Times New Roman'"&gt;Support for scrollable results and row count&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;We are working on addressing these feature requests for the next version of the extension.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;We are doing some preliminary work to test our existing version 1.0 extension with PHP 5.3 and providing guidance to help developers working with current builds of PHP 5.3 use the version 1.0 extension.&amp;nbsp; Keep an eye on this blog for more information regarding using the version 1.0 driver with PHP 5.3.&amp;nbsp; We expect to fully support PHP 5.3 with version 1.1 of our extension.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;For UTF-8 strings, we are working on adding support for this and other character sets to the extension.&amp;nbsp; Having the SQL Server Driver for PHP handle UTF-8 strings means that the extension will handle the translations between UTF-8 and UCS-2 (little endian) since the SQL Server database engine does not currently support the UTF-8 character set.&amp;nbsp; We're working on handling parameters and resultset values using UTF-8, as well as handling the query strings in UTF-8 format.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;We are also working on adding scrollable resultset support to the extension.&amp;nbsp; The initial version of the SQL Server Driver for PHP retrieves query results in an unbuffered forward-only mode, an approach that yields the best possible performance for retrieving query results from SQL Server but one where there is no way to know how many rows the resultset contains ahead of time.&amp;nbsp; We are planning on adding support for scrollable resultsets to the extension in version 1.1, giving PHP developers the ability to access any row as well as the ability to determine how many rows are available within the resultset.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;David Sceppa&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black"&gt;Program Manager - Microsoft SQL Server Driver for PHP&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9426834" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlphp/archive/tags/PHP/default.aspx">PHP</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/Row+count/default.aspx">Row count</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/UTF-8/default.aspx">UTF-8</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/v1.1/default.aspx">v1.1</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/Scrollable+results/default.aspx">Scrollable results</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/PHP+5.3/default.aspx">PHP 5.3</category></item><item><title>Functions to return row count and field count</title><link>http://blogs.msdn.com/sqlphp/archive/2008/03/05/functions-to-return-row-count-and-field-count.aspx</link><pubDate>Thu, 06 Mar 2008 03:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8075631</guid><dc:creator>dpblogs</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/sqlphp/comments/8075631.aspx</comments><wfw:commentRss>http://blogs.msdn.com/sqlphp/commentrss.aspx?PostID=8075631</wfw:commentRss><description>&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;It’s great to see that people are downloading our the February CTP build of our PHP driver and that we’re getting feedback on our new features.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We look forward to more of your feedback and we’re in the process of setting up a new forum specifically for questions and feedback for the PHP driver.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;A lot of the feedback has centered around requests for a num_rows function for the PHP driver.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In our PHP driver, we’re using the most performant way to retrieve the results of a SQL Server query, a forward-only read-only stream of data.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;With this approach there’s no way for the driver to know how the total number of rows that the query will return until you’ve finished processing the results of the query.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We could offer a num_rows function but without providing buffered resultsets, that num_rows function would only return the number of rows returned so far.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;While that appears to be a fairly standard behavior for drivers that don’t support buffered resultsets, it doesn’t strike me as adding a great deal of value.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;With that said, I’m curious as to whether there’s real interest in a num_rows function without adding support for buffered resultsets?&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;We are planning on adding a function to return the number of fields in a resultset later in this release.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There’s a simple workaround in the meantime – use the count function in conjunction with sqlsrv_field_metadata:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;$fieldCount = count(sqlsrv_field_metadata($stmt));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"&gt;&lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;The main benefit in adding a function to return this information is that returning the number of fields without generating the field metadata would be more performant.&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;David Sceppa&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Program Manager, SQL Server Driver for PHP&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8075631" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/sqlphp/archive/tags/PHP/default.aspx">PHP</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/Design/default.aspx">Design</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/Row+count/default.aspx">Row count</category><category domain="http://blogs.msdn.com/sqlphp/archive/tags/Field+count/default.aspx">Field count</category></item></channel></rss>