Hi there,
I have a problem that I am seeing as very complicated and I'm struggling to work out how to implement a solution.
I have a system that shows a random record from my database, but I don't want it to show previously shown records until every record has been shown.
Here's how I think it can be solved, every record is assigned a field that contains an integer. The integer starts as value 1, when the record is shown, it sets to value 2.
Then, when all record values are set to 2, a random record is chosen again, it is shown and the value set back to 1. It repeats like this for every record so that every record in the database is viewed before repeating previously viewed records.
The problem is that although I have this in my mind, I am struggling to work out how to actually implement it.
Any help is appreciated, I can attempt to explain more if required. Thanks!
I have a problem that I am seeing as very complicated and I'm struggling to work out how to implement a solution.
I have a system that shows a random record from my database, but I don't want it to show previously shown records until every record has been shown.
Here's how I think it can be solved, every record is assigned a field that contains an integer. The integer starts as value 1, when the record is shown, it sets to value 2.
Then, when all record values are set to 2, a random record is chosen again, it is shown and the value set back to 1. It repeats like this for every record so that every record in the database is viewed before repeating previously viewed records.
The problem is that although I have this in my mind, I am struggling to work out how to actually implement it.
Any help is appreciated, I can attempt to explain more if required. Thanks!