Jump to content

[SOLVED] while and foreach


monkeytooth

Recommended Posts

Not to positive about this so I'm gonna ask here..

For staters im not sure this is gonna work right as its a loop in a loop, but who knows it may.. over all though.. here it is

 

$counter = "1";
while ($row = mysql_fetch_array($query)) {
foreach ($row['pref'] >= '0') {
       	echo $counter . ".) " . $row['ptitle'] . " - " . $row['pref'] . "<br>";
$counter++;
}
}

 

error is

Parse error: parse error, unexpected ')'

Link to comment
https://forums.phpfreaks.com/topic/103259-solved-while-and-foreach/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.