Can anybody suggest me what is wrong in this code. I am trying to populate data from table to list field. Its showing error "Parse error: parse error in C:\wamp\www\matr\index.php "

</div><div style="padding: 3px 0px;">
			<select name="countryofresidence" style="width: 140px;"><option value="">Doesn't Matter</option>
			
			<?PHP
				$sqlCountry = "SELECT * FROM countries order by CountryID";
				$resultCountry = mysql_query($sqlCountry, $conn);
				if (@mysql_num_rows($resultCountry)!=0){
					while($rowCountry = mysql_fetch_array($resultCountry))
					{
						?>
						<option value="<?PHP echo $rowCountry['CountryID']?>"
						<?PHP
						if($_REQUEST['CountryID'] == $rowCountry['CountryID'])
							echo "selected";
						?>
						><?PHP echo $rowCountry['Country']?></option>
						<?
					}
				}				
				?>
			
			</select>

Parse errors come with the line number they errored on. It makes it easy to debug problems this way.

The error is showing in the end of code. So i am not able to track it down. If i remove this code then it is OK.

Hi ...

I think you've mixed php and html in line 11 (is there an echo statement missing?)

G-fer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.