Newer
Older
2022-KEGO / mycgi / rensyu5.rb
@Sato Keigo Sato Keigo on 20 Oct 2022 746 bytes add mycgi in 2022
#!/usr/bin/env ruby
# coding: utf-8
Encoding.default_external = 'utf-8'	# UTF-8のCSVファイルを読むため
require 'sqlite3'

array = []
#データベース読み取り処理は全く同じ
db = SQLite3::Database.new("gomi.db")
result = db.execute("SELECT * FROM gomi where name LIKE '%ロープ%';")
db.execute("SELECT * FROM gomi where name LIKE '%ロープ%';").each do |rs|
  array.push(rs)
  
end  
keep = array.join(",")
p keep[0]
keep1 = keep.split(",")
p keep1[0]
array.each { |row|
p array[0]}

 # printf("%s %s %s",rs[0],rs[1],rs[2])





















   # p result[0]
  # p result

# array = []
# keep = ""

# result.each do |row|
#   keep = row.join(",")
#   array = keep.split(",")

# end

# puts result[0]
# db.each{|row|