Loops

Here is how to use mySQLi, connect to the db and display records in loop.

{ 0 comments }

Array & Loop Example Suppose we have a form and we want from user to select from a list of check boxes and check his favorite choices, post that data as an array and we want to display that data by calling array and arranging it in a loop. Then for this purpose consider following […]

{ 0 comments }

PHP provides an easy way to use every element of an array with the For each statement. For each executes the code at each item in the specified array. While a For Loop and While Loop will continue until some condition fails, the For Each loop will continue until it has gone through every item […]

{ 0 comments }

A “do while” loop is a slightly modified version of the while loop. A do-while loop first do’s and secondly checks the while condition! PHP Do While Loop Structure – Define – Do – Print – Increment or decrement – Condition

{ 0 comments }

PHP While Loop

by Hiroshi on June 21, 2008

in Loops, PHP Basics, While Loop

The while keyword takes a condition in parentheses, and the code block that follows is repeated while that condition is true. If the condition is false initially, the code block will not be repeated at all. The repeating code must perform some action that affects the condition in such a way that the loop condition […]

{ 1 comment }

PHP For Loop

by Hiroshi on June 21, 2008

in For Loop, Loops, PHP Basics

For loop consists of three phases. i.e. Define Condition Increment or decrement First we define something. Then we apply a condition and then under that condition we increment or decrement that defined thing. In complex way; – The first part is an expression that is evaluated once when the loop begins. – The second part […]

{ 1 comment }