<?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: Mysqli Wrapper &#8211; Short and Secure Queries</title>
	<atom:link href="http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html</link>
	<description>French Web Developer</description>
	<lastBuildDate>Mon, 30 Jan 2012 14:23:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Brian Zeligson</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-8322</link>
		<dc:creator>Brian Zeligson</dc:creator>
		<pubDate>Sat, 12 Nov 2011 13:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-8322</guid>
		<description>Here&#039;s a fix for this, left by a commenter on my own blog. Credit and thanks to Peter Stacey for this one:

I was having this problem on a database that was used by existing application and so couldn&#039;t change the column type. After much searching I discovered that if you store the result of the query with $stmt-&gt;store_result(); before $stmt-&gt;bind_result($var) it works!

e.g.
$stmt-&gt;execute();
$stmt-&gt;store_result();
$stmt-&gt;bind_result($content);

Read more: PHP MySQLi returns empty variables from longtext column « Working In Boxer Shorts
</description>
		<content:encoded><![CDATA[<p>Here's a fix for this, left by a commenter on my own blog. Credit and thanks to Peter Stacey for this one:</p>
<p>I was having this problem on a database that was used by existing application and so couldn't change the column type. After much searching I discovered that if you store the result of the query with $stmt-&gt;store_result(); before $stmt-&gt;bind_result($var) it works!</p>
<p>e.g.<br />
$stmt-&gt;execute();<br />
$stmt-&gt;store_result();<br />
$stmt-&gt;bind_result($content);</p>
<p>Read more: PHP MySQLi returns empty variables from longtext column « Working In Boxer Shorts</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JG Estiot</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-8235</link>
		<dc:creator>JG Estiot</dc:creator>
		<pubDate>Fri, 02 Sep 2011 02:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-8235</guid>
		<description>Good job</description>
		<content:encoded><![CDATA[<p>Good job</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Zeligson</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-8222</link>
		<dc:creator>Brian Zeligson</dc:creator>
		<pubDate>Sun, 21 Aug 2011 03:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-8222</guid>
		<description>Yup thanks, I ended up finding that same post through Google. Changed the column to text. Low tech but it worked.</description>
		<content:encoded><![CDATA[<p>Yup thanks, I ended up finding that same post through Google. Changed the column to text. Low tech but it worked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP one line prepared statements! Mysqli will never be the same again. &#171; Working In Boxer Shorts</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-8216</link>
		<dc:creator>PHP one line prepared statements! Mysqli will never be the same again. &#171; Working In Boxer Shorts</dc:creator>
		<pubDate>Sat, 20 Aug 2011 14:47:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-8216</guid>
		<description>[...] via Mysqli Wrapper – Short and Secure Queries &#124; Vjeux. [...]</description>
		<content:encoded><![CDATA[<p>[...] via Mysqli Wrapper – Short and Secure Queries | Vjeux. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vjeux</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-8215</link>
		<dc:creator>Vjeux</dc:creator>
		<pubDate>Sat, 20 Aug 2011 10:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-8215</guid>
		<description>It looks like to be a bug due to mysqli:
  http://www.develobert.info/2009/09/php-mysqli-bindresult-empty-longtext.html</description>
		<content:encoded><![CDATA[<p>It looks like to be a bug due to mysqli:<br />
  <a href="http://www.develobert.info/2009/09/php-mysqli-bindresult-empty-longtext.html" rel="nofollow">http://www.develobert.info/2009/09/php-mysqli-bindresult-empty-longtext.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Zeligson</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-8214</link>
		<dc:creator>Brian Zeligson</dc:creator>
		<pubDate>Sat, 20 Aug 2011 03:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-8214</guid>
		<description>I love this class but for some reason I can&#039;t select data from a longtext field. I can see the data in phpmyadmin, but when I select it using the class and echo the variable in the array, I get blank space. Any ideas?</description>
		<content:encoded><![CDATA[<p>I love this class but for some reason I can't select data from a longtext field. I can see the data in phpmyadmin, but when I select it using the class and echo the variable in the array, I get blank space. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Me, myself and I</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-8032</link>
		<dc:creator>Me, myself and I</dc:creator>
		<pubDate>Sun, 06 Feb 2011 20:03:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-8032</guid>
		<description>I&#039;m trying to do something similar right now. Unfortunately your class lacks a facility to pass parameters to the SQL. I started with PHP this afternoon, so I&#039;m probably still stupid regarding PHP, but how about adding a second parameter to q, say an associative array, then use mysqli_STMT:bind_param() to add the parameters to the statement before executing it?</description>
		<content:encoded><![CDATA[<p>I'm trying to do something similar right now. Unfortunately your class lacks a facility to pass parameters to the SQL. I started with PHP this afternoon, so I'm probably still stupid regarding PHP, but how about adding a second parameter to q, say an associative array, then use mysqli_STMT:bind_param() to add the parameters to the statement before executing it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vjeux</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-6421</link>
		<dc:creator>vjeux</dc:creator>
		<pubDate>Fri, 26 Nov 2010 08:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-6421</guid>
		<description>@Cuke:
1) It returns false when there is an error. So you can do:
&lt;pre lang=&quot;php&quot;&gt;
$result = $db-&gt;q(&#039;...&#039;);
if (!$result) { Error() }
&lt;/pre&gt;

2) An object is automatically passed as reference, no need to add another one on top of it.

3) Free the returned array !? PHP has a garbage collector, the array will be freed as soon as you don&#039;t use it anymore.

@Timo:
Yeah, extending the mysqli object is a good idea. I didn&#039;t think about it when writing it.</description>
		<content:encoded><![CDATA[<p>@Cuke:<br />
1) It returns false when there is an error. So you can do:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">q</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$result</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> Error<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>2) An object is automatically passed as reference, no need to add another one on top of it.</p>
<p>3) Free the returned array !? PHP has a garbage collector, the array will be freed as soon as you don't use it anymore.</p>
<p>@Timo:<br />
Yeah, extending the mysqli object is a good idea. I didn't think about it when writing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-4865</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 07 Sep 2010 18:02:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-4865</guid>
		<description>oh excuse my last comment, I forgot to actually pass it in the function. derp.

Thanks for this, it&#039;s great!</description>
		<content:encoded><![CDATA[<p>oh excuse my last comment, I forgot to actually pass it in the function. derp.</p>
<p>Thanks for this, it's great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://blog.vjeux.com/2009/php/mysqli-wrapper-short-and-secure-queries.html/comment-page-1#comment-4864</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 07 Sep 2010 18:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vjeux.com/?p=94#comment-4864</guid>
		<description>Whenever I run this I get
Number of elements in type definition string doesn&#039;t match number of bind variables
from the line
&lt;pre lang=&quot;javascript&quot;&gt;
call_user_func_array(array($query, &#039;bind_param&#039;), $args_ref);
&lt;/pre&gt;

Doesn&#039;t bind_param have to be told what type each var that is passed is supposed to be? like string, integer, etc..</description>
		<content:encoded><![CDATA[<p>Whenever I run this I get<br />
Number of elements in type definition string doesn't match number of bind variables<br />
from the line</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">call_user_func_array<span style="color: #009900;">&#40;</span>array<span style="color: #009900;">&#40;</span>$query<span style="color: #339933;">,</span> <span style="color: #3366CC;">'bind_param'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> $args_ref<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Doesn't bind_param have to be told what type each var that is passed is supposed to be? like string, integer, etc..</p>
]]></content:encoded>
	</item>
</channel>
</rss>

