I have a syntax error on the following code which I am struggling to fix. Is there any form of validator or techniqie I can use to resolve it?

syntax error, unexpected ';'
include "access.php"; 

	$_POST['category'] = trim($_POST['category']);
	if(!empty($_POST['category'])) {
		$error = "Please select a category.";
	if(!isset($error)) {
		$category = mysql_real_escape_string($categories[$_POST['category']]);
		$linkcategory = str_replace(' ', '-',strtolower($_POST['category']);
		$linkcategory = mysql_real_escape_string($linkcategory);
		$sql = "INSERT INTO organiserdbase (category, linkcategory) VALUES ('$category','$linkcategory')";
		echo "$sql";
		$query = mysql_query($sql);
		if($query) {
		} else {
			$error = "There was a problem with the submission. Please try again.";

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
	<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
	<div id="registerpagecell">
		<div id="registerpageheaderorganiser">
		Create Your Organiser Profile 
		<div id="registerform">
			<form id="form_id" name="form_id" class="appnitro" method="post" action="">
				<?php if(isset($error)){ echo "<span style=\"color:#ff0000;\">".$error."</span><br /><br />";}?>
				<div id="forminputcell">
					<div id="forminputleft">
						<label class="description" for="element_3">Your Job Role:</label>
					<div id="forminputright">
						<select class="element select medium" name="category" id="category" > 
							<option value="" selected="selected">Venue:</option>
							<option value="Event Manager" >Event Manager</option>
							<option value="Event Managent Courses" >Event Managent Courses</option>
							<option value="Event Management Software" >Event Management Software</option>
							<option value="Entertainment Staff" >Entertainment Staff</option>
				<input type="submit" value="Submit" />