Hello,
I have yet another issue. I am writing a simple advertisement rotator for my website and every thing is working but something could "potentially" not work.
What I am doing to select randomly a ad from the database is counting the number of rows in my database then randomly picking a number from 1 to that amount of rows and calling the banner with the id of that number.
The issue is if I delete a banner (ie: banner 4) then add a new banner it starts at 5 and not four thus having ids like this:
1,2,3,5.
So my system will see there is 4 records and if it tries to call id 4 it gets an error. So that leaves me with my question:
Is there any way to randomly select from a database?