This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-06-30 14:36:52

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

PHP For Loop Error.

I'm having a problem.
Whats the problem with this loop? It looks fine!

Code:

for ($i = 0; 1 > 99; i++) {
    echo "<option value='" . i ."'>" . i . "</option"; 
}

Offline

 

#2 2011-06-30 14:45:47

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: PHP For Loop Error.

Code:

for ($i = 0; $i > 99; $i++) {
    echo "<option value='" . i ."'>" . i . "</option>"; 
}

Fixed  wink


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#3 2011-06-30 14:52:40

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: PHP For Loop Error.

meew0 wrote:

Code:

for ($i = 0; $i > 99; $i++) {
    echo "<option value='" . i ."'>" . i . "</option>"; 
}

Fixed  wink

Hmm, what was the problem?

lol. I did 1 as $i :S

Last edited by ProgrammingFreak (2011-06-30 14:55:44)

Offline

 

#4 2011-06-30 14:56:12

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: PHP For Loop Error.

It works!

Offline

 

#5 2011-06-30 14:57:25

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: PHP For Loop Error.

ProgrammingFreak wrote:

meew0 wrote:

Code:

for ($i = 0; $i > 99; $i++) {
    echo "<option value='" . i ."'>" . i . "</option>"; 
}

Fixed  wink

Hmm, what was the problem?

lol. I did 1 as $i :S

You also forgot an ending angle bracket in </option>  tongue
It's always ironic how you just can't figure something out, you go to ask for help, then you realize that you made a n00b mistake.  tongue


Yawn.

Offline

 

#6 2011-06-30 15:04:24

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: PHP For Loop Error.

meowmeow55 wrote:

ProgrammingFreak wrote:

meew0 wrote:

Code:

for ($i = 0; $i > 99; $i++) {
    echo "<option value='" . i ."'>" . i . "</option>"; 
}

Fixed  wink

Hmm, what was the problem?

lol. I did 1 as $i :S

You also forgot an ending angle bracket in </option>  tongue
It's always ironic how you just can't figure something out, you go to ask for help, then you realize that you made a n00b mistake.  tongue

ikr. Its kinda *. You'd think I'd have noticed it...  big_smile

Wow. I need a Basic Web Graphic Designer. Also includes frame and the whole 'look' of the website.

Offline

 

Board footer