A more efficient method that will work well for any number of cards would be the following:
1.Put all the n different cards in an array.
ar1[]={1,2,3,4,5...,n}
2.Also, have a counter c=n, and make another array of length n.
ar2[]={x,x,x,x,x...,x}
3.Then take a random between 0 and c-1(cardID=dbRND(c-1))
4.Then store array 1 element cardID in array 2 element n-c.(ar2[n-c]=ar1[cardID])
5.Then take ar1[c] and put it in ar1[cardID].(ar1[cardID]=ar1[c])
6. subtract 1 from c.(c--)
Repeat 3-6 until c==0,
but do not do this when c==0.
That should shuffle your deck of cards. You can now pick them in sequential order from ar2.