<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: PHP, Stored Procedures, and SQL Server</title>
	<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server</link>
	<description>The world according to marky moo</description>
	<pubDate>Fri, 10 Feb 2012 08:24:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Mark</title>
		<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146737</link>
		<author>Mark</author>
		<pubDate>Sat, 26 Nov 2011 12:39:07 +0000</pubDate>
		<guid>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146737</guid>
		<description>Thanks for the input Ian. This used to work with older versions of PHP, but things have changed a lot since 2005!</description>
		<content:encoded><![CDATA[<p>Thanks for the input Ian. This used to work with older versions of PHP, but things have changed a lot since 2005!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146703</link>
		<author>Ian</author>
		<pubDate>Sat, 24 Sep 2011 18:54:34 +0000</pubDate>
		<guid>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146703</guid>
		<description>Apologies the second example should be:

mssql_bind($stmt, “@outParam”, $outParam, true) // you don’t specify the &#38; for byref variables in PHP 5
$results = mssql_execute($stmt);
mssql_next_result($result); // this is cryptically explained in the note on doc page (http://php.net/manual/en/function.mssql-execute.php)
echo $outParam; // this should work now</description>
		<content:encoded><![CDATA[<p>Apologies the second example should be:</p>
<p>mssql_bind($stmt, “@outParam”, $outParam, true) // you don’t specify the &amp; for byref variables in PHP 5<br />
$results = mssql_execute($stmt);<br />
mssql_next_result($result); // this is cryptically explained in the note on doc page (http://php.net/manual/en/function.mssql-execute.php)<br />
echo $outParam; // this should work now</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146702</link>
		<author>Ian</author>
		<pubDate>Sat, 24 Sep 2011 17:48:17 +0000</pubDate>
		<guid>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146702</guid>
		<description>(submitted again as the comments don't like php tags in them)
Since your post came up when I was searching to figure out output parameters here's what you need to do:

Assuming we follow your mssql_bind, and if your stored procedure doesn't return any results you specify:
 
mssql_bind($stmt, "@outParam", $outParam, true) // you don't specify the &#38; for byref variables in PHP 5
mssql_execute($stmt, true); // the true means no results are returned
echo $outParam; // this should work now

If you do have a result set returned:

mssql_bind($stmt, "@outParam", $outParam, true) // you don't specify the &#38; for byref variables in PHP 5
mssql_execute($stmt, true); // the true means no results are returned
mssql_next_result($result); // this is cryptically explained in the note on doc page (http://php.net/manual/en/function.mssql-execute.php)
echo $outParam; // this should work now</description>
		<content:encoded><![CDATA[<p>(submitted again as the comments don&#8217;t like php tags in them)<br />
Since your post came up when I was searching to figure out output parameters here&#8217;s what you need to do:</p>
<p>Assuming we follow your mssql_bind, and if your stored procedure doesn&#8217;t return any results you specify:</p>
<p>mssql_bind($stmt, &#8220;@outParam&#8221;, $outParam, true) // you don&#8217;t specify the &amp; for byref variables in PHP 5<br />
mssql_execute($stmt, true); // the true means no results are returned<br />
echo $outParam; // this should work now</p>
<p>If you do have a result set returned:</p>
<p>mssql_bind($stmt, &#8220;@outParam&#8221;, $outParam, true) // you don&#8217;t specify the &amp; for byref variables in PHP 5<br />
mssql_execute($stmt, true); // the true means no results are returned<br />
mssql_next_result($result); // this is cryptically explained in the note on doc page (http://php.net/manual/en/function.mssql-execute.php)<br />
echo $outParam; // this should work now</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146701</link>
		<author>Ian</author>
		<pubDate>Sat, 24 Sep 2011 17:46:59 +0000</pubDate>
		<guid>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-146701</guid>
		<description>Since your post came up when I was searching to figure out output parameters here's what you need to do:

Assuming we follow your mssql_bind, and if your stored procedure doesn't return any results you specify:



If you do have a result set returned:

</description>
		<content:encoded><![CDATA[<p>Since your post came up when I was searching to figure out output parameters here&#8217;s what you need to do:</p>
<p>Assuming we follow your mssql_bind, and if your stored procedure doesn&#8217;t return any results you specify:</p>
<p>If you do have a result set returned:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: c4</title>
		<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-145079</link>
		<author>c4</author>
		<pubDate>Thu, 04 Dec 2008 04:10:57 +0000</pubDate>
		<guid>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-145079</guid>
		<description>Thanks for the post Mark, I'm new to this as well and your instructions are as clear as can be. Thanks for helping make sense of a new subject.

(CunningLinguist must have googled "damn the americans" and found this entry...)</description>
		<content:encoded><![CDATA[<p>Thanks for the post Mark, I&#8217;m new to this as well and your instructions are as clear as can be. Thanks for helping make sense of a new subject.</p>
<p>(CunningLinguist must have googled &#8220;damn the americans&#8221; and found this entry&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-21898</link>
		<author>Mark</author>
		<pubDate>Fri, 17 Nov 2006 15:49:45 +0000</pubDate>
		<guid>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-21898</guid>
		<description>Oops - thanks CunningLinguist! Spelling was never my strong point...</description>
		<content:encoded><![CDATA[<p>Oops - thanks CunningLinguist! Spelling was never my strong point&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CunningLinguist</title>
		<link>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-21866</link>
		<author>CunningLinguist</author>
		<pubDate>Fri, 17 Nov 2006 12:28:47 +0000</pubDate>
		<guid>http://www.sweeting.org/mark/blog/2005/02/24/php-stored-procedures-and-sql-server#comment-21866</guid>
		<description>If you are going to "damn the Americans and there Z’s!" (to which I agree), I think you should at least use "their" instead of "there".</description>
		<content:encoded><![CDATA[<p>If you are going to &#8220;damn the Americans and there Z’s!&#8221; (to which I agree), I think you should at least use &#8220;their&#8221; instead of &#8220;there&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

