Jump to content

while inside a foreach?


jeff5656

Recommended Posts

I get this error so I was wondering if it is because I can't put a while inside a foreach?

"syntax error, unexpected T_WHILE in home/g/h/t...."

 

while($rows=mysql_fetch_array($rr)){
	$pt_id = unserialize($rows['pts']);
		foreach ($pt_id as $indiv) {
			$q = "select * from indiv where id_incr = '$indiv'";
			echo $q;
			$result = mysql_query($q)
			while $ptrow =mysql_fetch_array($result)){
				echo $ptrow['v1'];
				echo "<br>";
			}
		}
}

Link to comment
https://forums.phpfreaks.com/topic/211111-while-inside-a-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.