# Search From Database

**URL:** <https://www.ruby-forum.com/t/search-from-database/142197>\
**Category:** Rails\
**Created:** [July 4, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/search-from-database/142197 "2008-07-04T12:54:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ganana\_srishti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e480ec/32.png) [@ganana\_srishti](https://www.ruby-forum.com/u/ganana_srishti)\
**Post date:** [July 4, 2008, 12:54pm UTC](https://www.ruby-forum.com/t/search-from-database/142197/1 "2008-07-04T12:54:16Z")

</div>

Hi,  
I have one array for example [1,2,3,4]  
and  
I want to check the array mathches in database

for example if this array mathches exactly  
[1,2,3,4] == [1,2,3,4]  
then storing it in one varibale  
then find the array matches for [1,2,3] (remove last element)  
then we will get some results and store it in one variable

The prblem here i am facing is how to remove last element of an array  
i.e. like [1,2,3] and how to check the array matches in table
