3. Your first while loop


#1



https://www.codecademy.com/courses/web-beginner-en-5YvPF/0/3?curriculum_id=5124ef4c78d510dd89003eb8


Parse error: syntax error, unexpected T_WHILE on line 12


<!DOCTYPE html>
<html>
    <head>
		<title>A loop of your own</title>
        <link type='text/css' rel='stylesheet' href='style.css'/>
	</head>
	<body>
     <?php
	//Add while loop below
    $scheduler = "booked";
    
    while($scheduler == "booked") {
        echo "i cannot book your appointment";
         }
         
         $scheduler = false; {
             echo "what time would you like your appointment?";
             }
    ?>
    </body>
</html>


#2

The above is more of an IF statement than a WHILE loop.

    <?php
    $scheduler = "booked";
    if ($scheduler == "booked") {
        echo "I cannot book your appointment";
    } else {
        echo "What time would you like your appointment?";
    }
    ?>

Try something simple that loops a few tims...

    <?php
    //Add while loop below
    $stop = false;
    $count = 10;
    while ($stop != true){
        echo "<p>$count</p>";
        $count--;        
        $stop = $count == 0;
    }
    echo "<p>Blast off!</p>";
    ?>

#3

Thx..

Btw....Do you think you will be adding Arduino?


#4

p.s I thought I had all that in a while loop not an If statement...silly me


#5

This is not a question that one can answer with any certainty. There is a Java course, but no C as yet, and no hardware projects. The open source community will be the place to go for training and support.


#6

thanks, I have my hands full here on this site..btw, it's the best online tutorial anywhere!