super new/silly question. I'm getting a 'syntax error, unexpected end of file in X' in my HTML/PHP form below. The idea is super simple, connect to a database, and search a table, output the information. Is there any obvious syntactical problem below that's prohibiting this code from running? (Also do you guys happen to see any logical flaws that would prohibit it from running correctly?)
<?php
//connect to DB
include("config.php");
$db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
//default output (for logic later)
$output = '';
//collect output from user
if(isset($_POST['search'])){
$searchq = $_POST['search'];
$query = mysqli_query($db, "SELECT * FROM tools WHERE toolName LIKE '%$searchq%' OR toolClassification LIKE '%$searchq%'") or die("Problem 2");
$count = mysql_num_rows($query);
if($count == 0){
$output = 'there was no search results';
} else {
while($row = mysql_fetch_array($query)) {
$toolName = $row['toolName'];
$toolClassification = $row['toolClassification'];
$output .= '<div> '.$toolName.' '.$toolClassification.'</div>';
}
}
?>
<html>
<head>
<title> Search </title>
</head>
<body>
<form action="search2.php" method="post">
<input type="text" name="search" placeholder="Search for tools...">
<input type="submit" value=">>" />
</form>
<?php
print("$output");
?>
</body>
</html>