Я использую SQLite3 для своей базы данных и получаю ошибку column index out of range
.
def Bookmark.searchBookmarks(search_input)
db = SQLite3::Database.new DATABASE
results = []
query = "SELECT bookmarks.bookmark_id, bookmarks.bookmark_name, bookmarks.description,bookmarks.hyperlink, bookmarks.rating,
(employees.forename + ' ' + employees.surname) AS complete_name
FROM #{BOOKMARKTABLE}
INNER JOIN employees
ON bookmarks.employee_id = employees.employee_id
WHERE bookmarks.bookmark_name LIKE '%?%'
OR bookmarks.description LIKE '%?%'
OR bookmarks.date_added LIKE '%?%'
OR bookmarks.hyperlink LIKE '%?%'
OR complete_name LIKE '%?%';"
rows = db.execute query, search_input, search_input, search_input, search_input, search_input
rows.each do |row|
result.push({bookmark_id: row[0], bookmark_name: row[1], description: row[2], hyperlink: row[3],rating: row[4], complete_name: row[5]})
end
return result
end
Что не так?