having some real difficulties with a loop I have that checks lottery numbers against users' selected numbers stored in a database. At the moment, the loop (below) will get all the users who have 1 ball that matches the lottery, but I don't know how to store this and keep cycling so that I only display users with 5 balls or 6 balls :-(. here is my loop so far:
if (ball1 == usersball1 || ball2 == usersball1 || ball3 == usersball1 || ball4 == usersball1 || ball5 == usersball1 || ball6 == usersball1 || ball1 == usersball2 || ball2 == usersball2 || ball3 == usersball2 || ball4 == usersball2 || ball5 == usersball2 || ball6 == usersball2 || ball1 == usersball3 || ball2 == usersball3 || ball3 == usersball3 || ball4 == usersball3 || ball5 == usersball3 || ball6 == usersball3 || ball1 == usersball4 || ball2 == usersball4 || ball3 == usersball4 || ball4 == usersball4 || ball5 == usersball4 || ball6 == usersball4 || ball1 == usersball5 || ball2 == usersball5 || ball3 == usersball5 || ball4 == usersball5 || ball5 == usersball5 || ball6 == usersball5 || ball1 == usersball6 || ball2 == usersball6 || ball3 == usersball6 || ball4 == usersball6 || ball5 == usersball6 || ball6 == usersball6)
{
lblResult.Visible = true;
lblResult.Text = lblResult.Text + "flag: " + System.Convert.ToString(flag) + lblOthers.Text + System.Convert.ToString(row2["UserName"]) + " matched at least 1 ball!<br />";
}
the ball1 etc are the numbers of the lottery and usersball1 etc are the users numbers in the database.
As I mentioned, this successfully outputs the users with 1 matching ball. I want to output users with 5 balls or over ideally. Any ideas how I can go about this?
thanks a LOT!