<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FLoops-For-Statement%2FEnglish</id>
		<title>PHP-and-MySQL/C2/Loops-For-Statement/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FLoops-For-Statement%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Loops-For-Statement/English&amp;action=history"/>
		<updated>2026-04-06T01:15:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Loops-For-Statement/English&amp;diff=538&amp;oldid=prev</id>
		<title>Chandrika: Created page with '{| border=1 !Time !Narration |- |0:00-0:14 | The basic principle of for loops is that it will repeat a block of codes the number of times you specify, using not only a condition …'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Loops-For-Statement/English&amp;diff=538&amp;oldid=prev"/>
				<updated>2012-11-29T06:36:28Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{| border=1 !Time !Narration |- |0:00-0:14 | The basic principle of for loops is that it will repeat a block of codes the number of times you specify, using not only a condition …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=1&lt;br /&gt;
!Time&lt;br /&gt;
!Narration&lt;br /&gt;
|-&lt;br /&gt;
|0:00-0:14&lt;br /&gt;
| The basic principle of for loops is that it will repeat a block of codes the number of times you specify, using not only a condition but also the  initialization in the beginning and the increment at the end. &lt;br /&gt;
|-&lt;br /&gt;
|0:18-0:25&lt;br /&gt;
| So how much you want to increment your variable determines the number of times your variable loops by. &lt;br /&gt;
|-&lt;br /&gt;
|0.30-0.38&lt;br /&gt;
|So, it is a bit more complex to write.  However it looks good , it does the job and its very compact.&lt;br /&gt;
|-&lt;br /&gt;
|0.42-0.43&lt;br /&gt;
|Now we write 'for'&lt;br /&gt;
|-&lt;br /&gt;
|0.44-0.53&lt;br /&gt;
|so you have got three parts of your code here,and your block and that is all you need and your content can go here.&lt;br /&gt;
|-&lt;br /&gt;
|0.54-1.03&lt;br /&gt;
|So, I am going to say 'echo' here and let's create a variable 'num'.  So, we have echoed out 'num'.&lt;br /&gt;
|-&lt;br /&gt;
|1.04-1.13&lt;br /&gt;
|In here, we write num =1, not = = 1 because we are setting the variable num to the value of 1.&lt;br /&gt;
|-&lt;br /&gt;
|1.15-1.22&lt;br /&gt;
|Then we have a condition.  For eg, while num &amp;lt; = to 10&lt;br /&gt;
|-&lt;br /&gt;
|1.23-1:31&lt;br /&gt;
|Then, we have the increment values.  So, we are going to have num ++ and the loop is done.&lt;br /&gt;
|-&lt;br /&gt;
|1:32-1:37&lt;br /&gt;
|So, we type 'For', and our variable-num=1&lt;br /&gt;
|-&lt;br /&gt;
|1:38-1:47&lt;br /&gt;
|Then we have our condition  'While num&amp;lt; =10, the loop will continue, and then we have num ++&lt;br /&gt;
|-&lt;br /&gt;
|1:48-1:52&lt;br /&gt;
|As you can see this is much more useful than having num ++ down below .&lt;br /&gt;
|-&lt;br /&gt;
|1:53-1:55&lt;br /&gt;
|and  we  need not  declare this up here.&lt;br /&gt;
|-&lt;br /&gt;
|1:56-1:59&lt;br /&gt;
|It can be declared inside these parentheses. &lt;br /&gt;
|-&lt;br /&gt;
|2:00-2:02&lt;br /&gt;
|O.K., I forgot the line-break.&lt;br /&gt;
|-&lt;br /&gt;
|2:03-2:07&lt;br /&gt;
|I’ll  add a line break on to the end of this.&lt;br /&gt;
|-&lt;br /&gt;
|2:09-2:10&lt;br /&gt;
|Refresh.&lt;br /&gt;
|-&lt;br /&gt;
|2:11-2:12&lt;br /&gt;
|There you go.  &lt;br /&gt;
|-&lt;br /&gt;
|2:15-2:17&lt;br /&gt;
|You've got your loop ten times.&lt;br /&gt;
|-&lt;br /&gt;
|2:18-2:25&lt;br /&gt;
|And as it has been specified in such a way it will loop only when num is less than or equal to 10.&lt;br /&gt;
|-&lt;br /&gt;
|2:26-2:28&lt;br /&gt;
|After that the loop will break and you may continue with the rest of the script. &lt;br /&gt;
|-&lt;br /&gt;
|2:31-2:36&lt;br /&gt;
|This is a bit more complex but once you learn the basics you will find it a lot easier .&lt;br /&gt;
|-&lt;br /&gt;
|2:37 &lt;br /&gt;
| Thanks for watching.&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>