I am trying to get 'Auto_increment' using mysql2 adapter with ruby 192. my code is
require 'mysql2'
require 'active_record'
ActiveRecord::Base.establish_connection( :adapter => 'mysql2', :database => 'my_db', :username => 'root', :password => '' )
result = ActiveRecord::Base.connection.execute "SHOW TABLE STATUS LIKE 'users'"
whe开发者_如何学编程never I am trying to print the fields and data using a loop, it gives me this error -
`local': argument out of range (ArgumentError)
But if I change my query to
result = ActiveRecord::Base.connection.execute "select * from users"
it works perfectly, any Idea ?
精彩评论