Going through a long array to find an item

Yes I have that index unless the player leaves the game. When he leaves and say comes back tomorrow, I have to get the items from the database, I’m getting the items’ names as strings from the database, and I have to find the actual items by looking at those names. Anyone can help with that? Or I’ll have to go through 1500 array.