selecting random rows and setting value to each one
Posted: Mon Jun 14, 2010 12:56 pm
Hi,
I am attempting to create a script that will give each row inside my database (each one contains a website url) a random value from 1 to the total number of rows in the table. Once each one is set, my script will go to the row with the value that has been set to 1. If that row's active status is == to Yes, and it's Credits > 0, the website will be selected to be shown to the user. If not, it will skip that row, and do the same checks for Row 2.
I'm having difficulty figuring this out.
I am attempting to create a script that will give each row inside my database (each one contains a website url) a random value from 1 to the total number of rows in the table. Once each one is set, my script will go to the row with the value that has been set to 1. If that row's active status is == to Yes, and it's Credits > 0, the website will be selected to be shown to the user. If not, it will skip that row, and do the same checks for Row 2.
I'm having difficulty figuring this out.