Well...
By just changing the code with the suggestion you added, appears to:
1) If isRandomable flag .... Jump to the URL
2) If not isRandomable flag.... Fall down and display a page saying No links were available.
This made sense in that it appears the original code is pulling the number of links available and randomizing the number from that.
Then it pulls the information from the link, if its available. With your suggestion, it looks like it will pull the information if it is available AND the isRandomable is set.
What I need to do is either:
1) keep looping until I hit a link that is available and isRandomable is set....
or
2) Query with the effect of
Select ID from Links
where Links.isRandomable = 'Yes'
Then then pick a random row from 0 to the query row count.
THEN pull the link info.
By just changing the code with the suggestion you added, appears to:
1) If isRandomable flag .... Jump to the URL
2) If not isRandomable flag.... Fall down and display a page saying No links were available.
This made sense in that it appears the original code is pulling the number of links available and randomizing the number from that.
Then it pulls the information from the link, if its available. With your suggestion, it looks like it will pull the information if it is available AND the isRandomable is set.
What I need to do is either:
1) keep looping until I hit a link that is available and isRandomable is set....
or
2) Query with the effect of
Select ID from Links
where Links.isRandomable = 'Yes'
Then then pick a random row from 0 to the query row count.
THEN pull the link info.