The Little Guy Posted November 13, 2007 Share Posted November 13, 2007 What would the best loop type be to check a value until it is true? I want to check a column in my database (website URL), then when I return the value of the column, I need to go out and look for a certain code on the web site that was returned from the database. If the code is NOT found, I would like to do the same process again. I would like to do so, until the proper code is found on the returned website. Quote Link to comment Share on other sites More sharing options...
Psycho Posted November 13, 2007 Share Posted November 13, 2007 Sounds like you want a WHILE loop, but what if the code is never returned? Your script would be caught in an infinite loop. So, you would want to implement a counter that will exit the loop after so many iterations. Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 13, 2007 Share Posted November 13, 2007 You could actually do something like that within about any loop construct you wish. Using continue or break, you can break out of one or more iterations when the TRUE is found. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 13, 2007 Share Posted November 13, 2007 what is the query looking like that might fix all your issues Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.