Re: Syntax error

From: Date: Tue, 28 Nov 2000 00:01:51 +0000
Subject: Re: Syntax error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27510@lists.php.net to get a copy of this message
Hi! the syntax is for($x=0;$x<3;$x++) { //foo } it looks then: while($row=mysql_fetch_row($resulta)) {$x = $row[1]; echo $x; for($i=0;$i<strlen($x);$i++) { echo $i; if ((substr($x,$i,1)==(substr($winner,$i,1)) { $y++; echo $y;} }} regards Folke -- Folke Ashberg Stage Internet Services GmbH Technical Development folke@fanstage.de folke@fanstage.de | Tel: +49 89 454591-77 | Fax: +49 89 454591-71 Kreillerstr. 21 | 81673 Munich | Germany | www.fanstage.de On Mon, 27 Nov 2000, Mike P wrote: > I keep getting a syntax error on line 25($y++).Ive tried every thing.I would > appreciate some help and some insight into the nesting rules. > $winner=111110011100111; > $y=0; > mysql_connect ("localhost","mpeloso","ampeloso") > or die("a"); > mysql_select_db("ampsoft_com") > or die("b"); > $resulta = mysql_query("Select User,Picks from Picks"); > while($row=mysql_fetch_row($resulta)) > {$x = $row[1]; > echo $x; > {for($i=0;$i<strlen($x);$i++) > echo $i; > {if ((substr($x,$i,1)==(substr($winner,$i,1)) > $y++; > echo $y;} > }} > > > mpeloso@princeton.edu > > > >

« previous php.general (#27510) next »