0

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>
3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by g-fer
0

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

0

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.

0

Hi ...

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

G-fer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.