Parse error: syntax error, unexpected 'en' (T_STRING) in C:\wamp\www\manilanorthcemeteryproject\search.php on line 7



I'm a student and is doing a project for school and I'm getting this error. This is the search function for the database that I'm making. I'm sorry if there has been too many questions such as this but I already checked and followed their advice. Can someone tell me what is wrong with my code? Any help would be greatly appreciated. Thanks in advanced!



<?php
mysqli_connect("localhost", "root", "") or die("Error connecting to database: ".mysql_error());
mysqli_select_db(localhost, root, ", manilanorthcemeteryproject) or die(mysqli_connect_error());
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="css/bootstrap.min.css" rel="stylesheet">
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php
$query = $_GET['query'];
$min_length = 2;
if(strlen($query) >= $min_length){

$query = htmlspecialchars($query);
$query = mysql_real_escape_string($query);
$raw_results = mysql_query("SELECT * FROM collection
WHERE (`record` LIKE '%".$query."%') OR (`datefiled` LIKE '%".$query."%') OR (`deceasedlastname` LIKE '%".$query."%') OR (`firstname` LIKE '%".$query."%') OR (`middlename` LIKE '%".$query."%') OR (`sectionnumber` LIKE '%".$query."%') OR (`lotnumber` LIKE '%".$query."%') OR (`gravenumber` LIKE '%".$query."%')") or die(mysql_error());
if(mysql_num_rows($raw_results) > 0){

while($results = mysql_fetch_array($raw_results)){

echo "<p><h3>".$results['filename']."</h3></p>";
echo "<p>".$results['record']."</p>";
echo "<p>".$results['datefiled']."</p>";
echo "<p>".$results['deceasedlastname']."</p>";
echo "<p>".$results['firstname']."</p>";
echo "<p>".$results['middlename']."</p>";
echo "<p>".$results['sectionnumber']."</p>";
echo "<p>".$results['lotnumber']."</p>";
echo "<p>".$results['gravenumber']."</ph>";
($results['id'])
}

}
else{
echo "No results. Try again.";
}

}
else{
echo "Minimum length is ".$min_length;
}
?>
<div class="form-actions">
<a class="btn btn-default" href="index.php">Back</a>
</div>
</body>
</html>

No comments:

Post a Comment