<?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"
	>
<channel>
	<title>Comments on: Ruby MySQL Tutorial</title>
	<atom:link href="http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/</link>
	<description>All about Ruby and Ruby on Rails.</description>
	<pubDate>Sat, 05 Jul 2008 18:14:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Tim</title>
		<link>http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-28196</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sat, 05 Jan 2008 04:30:02 +0000</pubDate>
		<guid isPermaLink="false">http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-28196</guid>
		<description>Regarding the observation that each_hash seems to erase the result set:  I just ran into this myself, and it took a while to figure it out.  You need to call data_seek(0) on the Result object after invoking each_hash, because each_hash advances the record pointer to the end of the result set.  If you call each_hash again without seeking back to record 0, each_hash will immediately return because the record pointer is already at the end.

Although this question is 7 months old, I am recording this answer for posterity, since my web searches for an answer lead me here first.</description>
		<content:encoded><![CDATA[<p>Regarding the observation that each_hash seems to erase the result set:  I just ran into this myself, and it took a while to figure it out.  You need to call data_seek(0) on the Result object after invoking each_hash, because each_hash advances the record pointer to the end of the result set.  If you call each_hash again without seeking back to record 0, each_hash will immediately return because the record pointer is already at the end.</p>
<p>Although this question is 7 months old, I am recording this answer for posterity, since my web searches for an answer lead me here first.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1281</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Mon, 28 May 2007 23:43:06 +0000</pubDate>
		<guid isPermaLink="false">http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1281</guid>
		<description>I am a newbie to rails and I  found I was having the same problem.  I think that it is a problem with the libmysql.dll.  See this mysql bug.  http://bugs.mysql.com/bug.php?id=28358

Fortunately I pulled off the libmysql.dll from another machine (sorry I didn't check which exact version of mysql is running on my other computer  but the libmysql.dll has a creation date of Oct. 22, 2006.  Once I replaced the libmysql.dll in the mysql/bin directory on my machine, I was able to run irb and issue the following commands:

  require 'mysql'
  puts Mysql::VERSION

Here's where I got the low down on those mysql gems in case you need it.
http://www.vandomburg.net/pages/mysql-ruby-windows</description>
		<content:encoded><![CDATA[<p>I am a newbie to rails and I  found I was having the same problem.  I think that it is a problem with the libmysql.dll.  See this mysql bug.  <a href="http://bugs.mysql.com/bug.php?id=28358" rel="nofollow">http://bugs.mysql.com/bug.php?id=28358</a></p>
<p>Fortunately I pulled off the libmysql.dll from another machine (sorry I didn&#8217;t check which exact version of mysql is running on my other computer  but the libmysql.dll has a creation date of Oct. 22, 2006.  Once I replaced the libmysql.dll in the mysql/bin directory on my machine, I was able to run irb and issue the following commands:</p>
<p>  require &#8216;mysql&#8217;<br />
  puts Mysql::VERSION</p>
<p>Here&#8217;s where I got the low down on those mysql gems in case you need it.<br />
<a href="http://www.vandomburg.net/pages/mysql-ruby-windows" rel="nofollow">http://www.vandomburg.net/pages/mysql-ruby-windows</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Walker</title>
		<link>http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1234</link>
		<dc:creator>Walker</dc:creator>
		<pubDate>Wed, 23 May 2007 20:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1234</guid>
		<description>I'm new to ruby and mysql.  A Mysql::result object erases itself after running each_hash on it once.  By erasing itself I mean that you won't get any results if you run the each_hash method on the same object again.  Can you help me understand why this is?  I've noticed this behavior on some of the other functions, and can kind of guess why it is happening, but I want to gather more information from anyone who knows more.  Thanks!</description>
		<content:encoded><![CDATA[<p>I&#8217;m new to ruby and mysql.  A Mysql::result object erases itself after running each_hash on it once.  By erasing itself I mean that you won&#8217;t get any results if you run the each_hash method on the same object again.  Can you help me understand why this is?  I&#8217;ve noticed this behavior on some of the other functions, and can kind of guess why it is happening, but I want to gather more information from anyone who knows more.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: satish</title>
		<link>http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1167</link>
		<dc:creator>satish</dc:creator>
		<pubDate>Wed, 16 May 2007 14:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1167</guid>
		<description>Some .dll problem? See this thread -
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/29579</description>
		<content:encoded><![CDATA[<p>Some .dll problem? See this thread -<br />
<a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/29579" rel="nofollow">http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/29579</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Monahan</title>
		<link>http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1165</link>
		<dc:creator>Dick Monahan</dc:creator>
		<pubDate>Wed, 16 May 2007 12:57:42 +0000</pubDate>
		<guid isPermaLink="false">http://rubylearning.com/blog/2007/05/14/ruby-mysql-tutorial/#comment-1165</guid>
		<description>As soon as I type require 'mysql', it crashes.  Any ideas?  I have tried both 2.7.1 and 2.7.3.  I have MySql 5.0.41.

D:\rem&#62;irb
irb(main):001:0&#62; require 'mysql'
LoadError: 998: Invalid access to memory location.   - c:/Program Files/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/mysql.so
        from c:/Program Files/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/mysql.so
        from c:/Program Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from (irb):1
irb(main):002:0&#62;</description>
		<content:encoded><![CDATA[<p>As soon as I type require &#8216;mysql&#8217;, it crashes.  Any ideas?  I have tried both 2.7.1 and 2.7.3.  I have MySql 5.0.41.</p>
<p>D:\rem&gt;irb<br />
irb(main):001:0&gt; require &#8216;mysql&#8217;<br />
LoadError: 998: Invalid access to memory location.   - c:/Program Files/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/mysql.so<br />
        from c:/Program Files/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/mysql.so<br />
        from c:/Program Files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require&#8217;<br />
        from (irb):1<br />
irb(main):002:0&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
