Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple way to grab name from list

Status
Not open for further replies.

mwpclark

Programmer
Mar 14, 2005
59
US
Hi

I have a list of cities over 6,000 population in the U.S., for example in California there are 549 cities in the list.

I wrote a script that grabs an xml file and outputs rss 2.0, and I want to plug in a different city name each time the script is run. The script will be run every 1/2 hour, so for each state, every so many days it will start over at the beginning of the list of cities.

What is the simplest way for php to do this? I can put the list in mysql, or in a php file, or in a text file, whatever.

One thought would be to put it in mysql, and put today's date in a date field for all the entries to start with. Then when the script is run, select the oldest entry (limit 1), use that city name in my output and write the current date to mysql when finished. But that seems complicated

Any thoughts will be appreciated.

Thanks
Mike

 
i think you could do as suggested but omit the initial step of defaulting today's date (even though to do so might be cleaner and would only take a second or so).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top