<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using Stored Procedures &amp; MySQLI in PHP 5</title>
	<atom:link href="http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/</link>
	<description>A periodical blog of experiences from the angle of an autodidactic, paranoid and narcissistic web developer...</description>
	<lastBuildDate>Thu, 04 Mar 2010 21:21:10 +1100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
	<item>
		<title>By: rvdavid</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-774</link>
		<dc:creator>rvdavid</dc:creator>
		<pubDate>Sat, 09 Jan 2010 22:03:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-774</guid>
		<description>You&#039;re welcome :) Glad you found it useful.</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome <img src='http://www.rvdavid.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Glad you found it useful.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kanna</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-772</link>
		<dc:creator>kanna</dc:creator>
		<pubDate>Sat, 09 Jan 2010 18:24:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-772</guid>
		<description>Thanks a lot!!!!!!!!</description>
		<content:encoded><![CDATA[<p>Thanks a lot!!!!!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edo Williams</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-608</link>
		<dc:creator>Edo Williams</dc:creator>
		<pubDate>Fri, 07 Aug 2009 18:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-608</guid>
		<description>I am a bit new to PHP and MYSQL. I have been having some issues getting my stored procedure to work.

What I am trying to do is use a query result to execute a stored procedure.

logic
Query 1 executes returning id value
Query 2(stored procedure) needs the id value to return result.

code
//I run through the first query and save it into an array
$query_security = &quot;SELECT m.id FROM gfd.masterlist m&quot;;
$result_s = $link-&gt;query($query_security, MYSQLI_STORE_RESULT);
$i = 0;
				while(list($id, $filename, $begin, $send) = $result_s-&gt;fetch_row()) {
					$filenameID_result[$i][&quot;id&quot;]=$id;
					$i++;
				}

mysqli_free_result($result_s);
				
for($i=0; $i&lt;count($filenameID_result); $i++) {
					$query = &quot;CALL sp_CompareSetOHCL(&#039;&quot;.$filenameID_result[$id]&#039;&quot;)&quot;;
				    $result_id = mysqli_query($link, $query);
					while(mysqli_next_result($link)){
						while($data = mysqli_fetch_assoc($result_id)){
							$o .= &#039;
							&#039;.$filenameID_result[$i][&quot;id&quot;].&#039;
					       &#039;;
						}
					}
				}



I come from the background of SQL server where I can store this in a results set and not have to deal with memory errors. Most of the error messages i am getting is memory and non execute.
Can someone help me.
Thanks</description>
		<content:encoded><![CDATA[<p>I am a bit new to PHP and MYSQL. I have been having some issues getting my stored procedure to work.</p>
<p>What I am trying to do is use a query result to execute a stored procedure.</p>
<p>logic<br />
Query 1 executes returning id value<br />
Query 2(stored procedure) needs the id value to return result.</p>
<p>code<br />
//I run through the first query and save it into an array<br />
$query_security = &#8220;SELECT m.id FROM gfd.masterlist m&#8221;;<br />
$result_s = $link-&gt;query($query_security, MYSQLI_STORE_RESULT);<br />
$i = 0;<br />
				while(list($id, $filename, $begin, $send) = $result_s-&gt;fetch_row()) {<br />
					$filenameID_result[$i]["id"]=$id;<br />
					$i++;<br />
				}</p>
<p>mysqli_free_result($result_s);</p>
<p>for($i=0; $i&lt;count($filenameID_result); $i++) {<br />
					$query = &#8220;CALL sp_CompareSetOHCL(&#8216;&#8221;.$filenameID_result[$id]&#8216;&#8221;)&#8221;;<br />
				    $result_id = mysqli_query($link, $query);<br />
					while(mysqli_next_result($link)){<br />
						while($data = mysqli_fetch_assoc($result_id)){<br />
							$o .= &#8216;<br />
							&#8216;.$filenameID_result[$i]["id"].&#8217;<br />
					       &#8216;;<br />
						}<br />
					}<br />
				}</p>
<p>I come from the background of SQL server where I can store this in a results set and not have to deal with memory errors. Most of the error messages i am getting is memory and non execute.<br />
Can someone help me.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-492</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 06 Apr 2009 13:53:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-492</guid>
		<description>Thanks a lot - your article was the solution for my mysqli problem!</description>
		<content:encoded><![CDATA[<p>Thanks a lot &#8211; your article was the solution for my mysqli problem!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gros</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-395</link>
		<dc:creator>gros</dc:creator>
		<pubDate>Sun, 01 Mar 2009 10:09:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-395</guid>
		<description>could you please show how to use mutli_query for an INSERT statement, and then retrieve insert_id.
thanks</description>
		<content:encoded><![CDATA[<p>could you please show how to use mutli_query for an INSERT statement, and then retrieve insert_id.<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tarek</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-378</link>
		<dc:creator>tarek</dc:creator>
		<pubDate>Mon, 29 Dec 2008 12:41:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-378</guid>
		<description>would you please post a sample code of how to use an update Stored Procedure (update news set News_Date = NewsDate , News_Title = NewsTitle , News_Details = NewsDetails where News_ID =NewsID ) within php using mysqli.

Thanks in advance.</description>
		<content:encoded><![CDATA[<p>would you please post a sample code of how to use an update Stored Procedure (update news set News_Date = NewsDate , News_Title = NewsTitle , News_Details = NewsDetails where News_ID =NewsID ) within php using mysqli.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tarek</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-376</link>
		<dc:creator>tarek</dc:creator>
		<pubDate>Sat, 27 Dec 2008 17:30:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-376</guid>
		<description>i am new to PHP.

i have this code that calls an Update stored procedure

require(&quot;../config.inc.php&quot;);

$mysqli = new mysqli($server,$username,$password,$db);

if (mysqli_connect_errno()) {
echo &quot;connection error&quot;;
exit();
}

/*
 Call my stored procedure the first time
 
 update news set News_Date = NewsDate , News_Title = NewsTitle , News_Details = NewsDetails where News_ID =NewsID
 NewsDate varchar(100), NewsTitle varchar(200), NewsDetails longtext
  */
 
	$date= date_create(changeDate(&quot;$Date&quot;).&quot; &quot;.date(&quot;H:i:s&quot;));
	$shortDate = date_format($date,&#039;Y-m-d H:i:s&#039;); 
	
/*	print ( $shortDate .&quot;/&quot;. $Title .&quot;/&quot;. $Det .&quot;/&quot;. $I);*/

	if ($mysqli-&gt;multi_query(&quot;call News_Update_ByID((string)$shortDate,(string)$Title,(string)$Det,(int)$I)&quot;)) 
	{
	
		LoadNews($I);
		
	}
	else
	{
    	
	print (&quot;Nothing Updated.&quot;);
	exit();
	}

	

the first parameter i pass is a datetime.

the query doesnt work. please help.</description>
		<content:encoded><![CDATA[<p>i am new to PHP.</p>
<p>i have this code that calls an Update stored procedure</p>
<p>require(&#8220;../config.inc.php&#8221;);</p>
<p>$mysqli = new mysqli($server,$username,$password,$db);</p>
<p>if (mysqli_connect_errno()) {<br />
echo &#8220;connection error&#8221;;<br />
exit();<br />
}</p>
<p>/*<br />
 Call my stored procedure the first time</p>
<p> update news set News_Date = NewsDate , News_Title = NewsTitle , News_Details = NewsDetails where News_ID =NewsID<br />
 NewsDate varchar(100), NewsTitle varchar(200), NewsDetails longtext<br />
  */</p>
<p>	$date= date_create(changeDate(&#8220;$Date&#8221;).&#8221; &#8220;.date(&#8220;H:i:s&#8221;));<br />
	$shortDate = date_format($date,&#8217;Y-m-d H:i:s&#8217;); </p>
<p>/*	print ( $shortDate .&#8221;/&#8221;. $Title .&#8221;/&#8221;. $Det .&#8221;/&#8221;. $I);*/</p>
<p>	if ($mysqli-&gt;multi_query(&#8220;call News_Update_ByID((string)$shortDate,(string)$Title,(string)$Det,(int)$I)&#8221;))<br />
	{</p>
<p>		LoadNews($I);</p>
<p>	}<br />
	else<br />
	{</p>
<p>	print (&#8220;Nothing Updated.&#8221;);<br />
	exit();<br />
	}</p>
<p>the first parameter i pass is a datetime.</p>
<p>the query doesnt work. please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Himanshu</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-370</link>
		<dc:creator>Himanshu</dc:creator>
		<pubDate>Fri, 12 Dec 2008 05:45:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-370</guid>
		<description>Great!
It was the solution I was looking for since long.
Thanks.</description>
		<content:encoded><![CDATA[<p>Great!<br />
It was the solution I was looking for since long.<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: beely</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-367</link>
		<dc:creator>beely</dc:creator>
		<pubDate>Sun, 07 Dec 2008 08:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-367</guid>
		<description>Great info you had post, and thank for guidelines of how to retrieve resultset from stored procedure. It help me alot of understanding. I wonder whether any solution for mySQL (not with mySQLi extension) could able to return resultset from the stored procedure?</description>
		<content:encoded><![CDATA[<p>Great info you had post, and thank for guidelines of how to retrieve resultset from stored procedure. It help me alot of understanding. I wonder whether any solution for mySQL (not with mySQLi extension) could able to return resultset from the stored procedure?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Farhan</title>
		<link>http://www.rvdavid.net/using-stored-procedures-mysqli-in-php-5/#comment-359</link>
		<dc:creator>Farhan</dc:creator>
		<pubDate>Wed, 08 Oct 2008 08:31:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.rvdavid.net/blog/using-stored-procedures-mysqli-in-php-5/#comment-359</guid>
		<description>Hi i am unable to call and fetch the records two time the next one is giving error,

i ma using mysqli with stored procedure in PHP5.

any Help please.</description>
		<content:encoded><![CDATA[<p>Hi i am unable to call and fetch the records two time the next one is giving error,</p>
<p>i ma using mysqli with stored procedure in PHP5.</p>
<p>any Help please.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
