PHP & MYSQL

POST – Review

POST – Review In our PHP Forms Lesson we used the post method. This is what the pertinent line of HTML code looked like: HTML Code Excerpt: <form action=”process.php” method=”post”> <select name=”item”> … <input name=”quantity” type=”text” /> This HTML code specifies that the form data will be... (Continue reading)

Tagged with:                         

PHP – While Loop and Do While Loop Contrast

A simple example that illustrates the difference between these two loop types is a conditional statement that is always false. First the while loop: PHP Code: $cookies = 0; while($cookies > 1){ echo “Mmmmm…I love cookies! *munch munch munch*”; } Display: As you can see, this while... (Continue reading)

Tagged with:                     

PHP For Each

We have an associative array that stores the names of people in our company as the keys with the values being their age. We want to know how old everyone is at work so we use a Foreach loop... (Continue reading)

PHP – For Loop

The for loop is simply a while loop with a bit more code added to it. The common tasks that are covered by a for loop are: Set a counter variable to some initial value. Check to see if the conditional... (Continue reading)

Tagged with: