*Solved*

The solution was for me to use findValue in the array... The array consist of id and passwords and by placing the pw directly after the id then findValue of the id + 1 makes the index of the pw that is easy to use:
if (pw == array[pwindex])
{ a.s.o. }