PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
hi guys, i have a code that reads a txt file full of random names and inserts 1 name into my mysql table. with this i have a form where i enter a number and the page will refresh that amount of times to insert that number of random names. this uses alot of resources and i am looking for a code that will take the number and print the code that many times on the same page.
something like if i enter 1 it will print 'hello' once, if i enter 5 it will print 'hello' 5times.
i hope this makes sence and that someone will be able to help me with some ideas.
What you are looking for is a for() loop. This runs a section a certain amount of times. You can either set the variable in the code or get them from your form:
thanks guys, i have just finnished converting my 2 scripts, maybe i should look a little harder as i found this solution before i read your posts... it depends how u word it when using google. a for loop is exactly what i was needing, thanks