Using only once and start from beginning again
Here is what I am trying to accomplish:
I have 500 usernames in my database. For each username in my database, I want to start from the first username, and call a function 10 times.
So example,
- username1 - function called.
- username2- function called.
- username3- function called.
- username4- function called.
- username5- function called.
- username6- function called.
- username7- function called.
- username8- function called.
- username9- function called.
- username10- function called.
Now we left off at username10, if I wanted to continue from username10 another day, how can I do this? I know you can add a new column to the database saying used and set it to '1' but, what if I did all 500, and want to start back over from username1 again? How 开发者_如何学Gocan I do this?
Also when I am calling a function for each username, how can I log the process like above into a iframe?
If you want to use the "used" column method, here's how you set every user to unused:
UPDATE `mytable` SET `used`=0;
I don't know what you mean by "log it to an iframe", but you could log all of the operations to a file, with fwrite - here's the documentation.
Edit:
Select all entries from table that have `checked`=0. For each of these entries
Execute the functions you need to execute
Set `checked`=1
When you want to start over
Set `checked`=0 for all entires. Execute code above.
精彩评论